R: using IMPORT
"Luca Notari" <[email protected]> Tue, 17 Oct 2006 08:58:36 +0200
| Newsgroups | gmane.comp.apache.mod-survey.general |
|---|---|
| Message-ID | <000201c6f1b9$ab4298b0$0300a8c0@evo01> |
The example below works fine, but what if I need more variables from a DB in a page? I've noticed that the import tag can exist once in a page (2 import tags containing 2 different variables returned a document error for me...) , and, unfortunately, FILTER tag once, too. My needs are to retrieve 8 variables from 8 different columns using filter (myvar1=1, myvar2=1....) using the count function... So, my problem is to retrieve 8 variables, from values previously accumulated by respondents during the survey, and pick from those the lowest value (with a perl snippet) . In other environments I've used simple text files (myvar1.txt,myvar2.txt...) which contained simply a number value (the total respondent that affected this variable). May I have to "break" the survey (for example with a php page), or is possible also, for example have an access and write to a simple .txt file in the filesystem? -----Messaggio originale----- Da: [email protected] [mailto:[email protected]] Per conto di Joel Palmius Inviato: lunedì 16 ottobre 2006 13.52 A: [email protected] Oggetto: Re: survey-discussion-list: using IMPORT 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 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.3/473 - Release Date: 12/10/2006 -- 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 "Luca Notari" <[email protected]> till survey-discussion