> I have a list of comma seperated numbers in a field in my
> database.  I would like to retrieve this list of numbers,
> which are primary keys to other tables) and loop through
> them, running a query for each number(key).  Here's
> what I have:
>
> ----- snip -----
> <CFQUERY name="qryGetKidsFromParentsID" datasource="Gymtime">
>         SELECT emer_ref FROM contact WHERE contact_id = #URL.sel#
> </cfquery>
> ----- snip -----
> <CFLOOP index="varLoopKidIDFromParentRelationships"
> list="qryGetKidsFromParentsID.emer_ref" delimiters=",">
> ----- snip -----
>
> The error I am getting is this:
>
> ----- -----
> ODBC Error Code = S0002 (Base table not found)
>
> [Sybase][ODBC Driver][Adaptive Server Anywhere] Table or view
> not found:
> Correlation name 'qryGetKidsFromParentsID' not found
> ----- -----
>
> The list="Query.Value" sounds good in theory, but I'm sure
> I'm doing it way wrong.  Any suggestions?

A query column isn't a list. If you want to copy it into a list, use the
ValueList or QuotedValueList functions:

<CFLOOP LIST="#ValueList(myquery.mycolumn)#" INDEX="i">

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to