Re: using IMPORT
Joel Palmius <[email protected]> Mon, 16 Oct 2006 13:51:51 +0200 (CEST)
| Newsgroups | gmane.comp.apache.mod-survey.general |
|---|---|
| Message-ID | <[email protected]> |
Hrm, I'm not exactly sure I understand what you want to do, but perhaps
something like this?
<SURVEY TITLE="import">
<IMPORT DBIDSN="DBI:Pg:dbname=joepal" DBITABLE="armorbrand" DBIUSER="joepal">
<VARIABLE NAME="arm" FIELD="count(*) as armors" />
<FILTER CRITERIA="NOT name ISNULL" />:
</IMPORT>
<TEXT NAME="armor" CAPTION="Add new brand (there are currently {$arm$} brands in DB)" />
</SURVEY>
Idea is to import a count() as a variable and then use it with {$..$} in
output.
Bugant probably has a better way to do this, I never worked much with the
IMPORT tag.
// Joel
On Fri, 13 Oct 2006, Luca Notari wrote:
> Hi all,
>
> I'm using for a survey DBI instruction for saving data in a database.
> I have a question about IMPORT tag and his sub-tags.
>
> this is what I have to do (is possible using an SQL statement):
>
> I have to ask a question, that requires checking back a sum of responses
> (quota) by precedent respondents.
>
> a question possible is: "do you have a dog? So far, we've collected XX
> dog(s)".
>
> with a SQL statement such "select count(the_dog_column) from
> people_table where the_dog_column='yes'" i can fetch data that i need.
>
> Shortly, I have to retrieve this data but I don't want to populate a
> list.
>
> do subtags as filter, variable supports retrieving a sum of records
> matching a criteria from a database?
>
> regards,
>
> Luca Notari
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.408 / Virus Database: 268.13.3/473 - Release Date:
> 12/10/2006
>
>
Skickat av Joel Palmius <[email protected]>
till survey-discussion