RE: making a query

2008-01-31 Thread Dave Watts
 Why do I get 36 records in my query when there should only be 
 8?  I must be doing something wrong with the AddRow and SetCell???
 
 ...
 
 cfloop from=1 to=#listLen(URL.SKUList)# index=i
   cfscript
   QueryAddRow(getSKUs, #variables.i#);
 ...

The second, optional argument for QueryAddRow specifies the number of rows
to add, not what the position of the added row should be. On the first
iteration of the loop, this will add one row to your query. On the second
iteration, it'll add two, and so on. If you only want to add one row, omit
the second argument of QueryAddRow.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Training: Adobe/Google/Paperthin Certified Partners
http://training.figleaf.com/

WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers!
http://www.webmaniacsconference.com/

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297858
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: making a query

2008-01-31 Thread Chad Gray
AH... thanks Dave!  That makes sense.

I thought it was the row number that the second attribute represented.  Like 
QueryAddRow was targeting a row number to insert into the query... 

Thanks!



-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 31, 2008 5:52 PM
To: CF-Talk
Subject: RE: making a query

 Why do I get 36 records in my query when there should only be 
 8?  I must be doing something wrong with the AddRow and SetCell???
 
 ...
 
 cfloop from=1 to=#listLen(URL.SKUList)# index=i
   cfscript
   QueryAddRow(getSKUs, #variables.i#);
 ...

The second, optional argument for QueryAddRow specifies the number of rows
to add, not what the position of the added row should be. On the first
iteration of the loop, this will add one row to your query. On the second
iteration, it'll add two, and so on. If you only want to add one row, omit
the second argument of QueryAddRow.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Training: Adobe/Google/Paperthin Certified Partners
http://training.figleaf.com/

WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers!
http://www.webmaniacsconference.com/



~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297860
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


making a query

2008-01-31 Thread Chad Gray
Why do I get 36 records in my query when there should only be 8?  I must be 
doing something wrong with the AddRow and SetCell???

Im a little fried right now so I need an extra set of eyes.



cfset url.SKUList = 
940172000,990082202,990125104,080182700,080182722,940163500,940163518,940163520

cfset getSKUs = QueryNew(SKU,varchar)

cfloop from=1 to=#listLen(URL.SKUList)# index=i
cfscript
QueryAddRow(getSKUs, #variables.i#);
QuerySetCell(getSKUs, SKU, #listGetAt(URL.SKUList, i)#, 
#variables.i#);
/cfscript
/cfloop

cfdump var=#getSKUs#


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:297854
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4