Ronan rather than run this as a query and than a number of queries in the
loop you might want to consider trying:

<cfquery name="myQuery" datasource="#request.dsn#">

        SELECT itemTable.itemId,
                        itemTable.ItemName,
                        categoryTable.categoryName
        FROM itemTable
        INNER JOIN categoryTable
        ON itemTable.itemId = categoryTable.itemid
        ORDER BY itemTable.itemID

</cfquery>

<cfset arrItemCategories = arrayNew(1)>

<cfoutput query="myQuery">

        <cfset arrItemCategories[1] = arrayNew(1)>
        
        <cfset arrItemCategories[1][1] = itemid>

        <cfset categoryArray = arrayNew(1)>

        <cfoutput>
        
                <cfset garbage = arrayAppend(categoryArray, #categoryName#)>

        </cfoutput>

        <cfset arrItemCategories[1][2] = categoryArray>

</cfoutput>

As far as marking this as an exit variable in fusedocs I would try:

<== (or <--) arrItemCategories: ARRAY: this is a complex data structure an
array of arrays of arrays that represent an item id and all their categories
in the following structure
(itemid:categoryName,categoryName,categoryName|itemid:categoryName,categoryN
ame,categoryName|itemid:categoryName,categoryName,categoryName

I like to have only one variable exiting a fuse (if it's complex use an
array or a structure).

I'm also not sure that the above syntax will work cut and paste but I think
the idea should work.

-----Original Message-----
From: Ronan O'Donohoe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 11:00 AM
To: Fusebox
Subject: RE: more syntax...


I posted this earlier but didn't get any responses...so one last time I ask:


I have a query template that produces multiple Valuelists. As the number of
variables from the first query dynamic I've set it up like so:

<CFQUERY NAME="getvariables" DATASOURCE="#request.dsn#" DBTYPE="ODBC">
        SELECT ItemId, ItemName
        FROM ItemTable
</CFQUERY>

Now theses variables belong to more than one category and I wish to call
them up for display, so...

<CFOUTPUT QUERY="getVariables">
        <CFQUERY NAME="getCategories" DATASOURCE="#request.dsn#"
DBTYPE="ODBC">
                SELECT categoryName
                FROM CategoryTable
                WHERE ItemId = #itemId#
        </CFQUERY>
<CFSET "List#ItemId#" = ValueList(getCategories.categoryName)>
</CFOUTPUT> 
 
My question is this, how do I mark this ("List#ItemId#" ) as an exit
variable in the qry_template.cfm  and an entry variable in my
dsp_template.cfm fusedocs so that's clear to the person who ends up coding
for it? ?

Thanks for any suggestions

 
Ronan O'Donohoe
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to