Title: Message

greg,

programmatically it should be ok.. efficiency-wise i have no idea... i am sure someone out there can show you a better way.

remember that the number of values in the 2 lists (productid and price) must be identical for this to work, so make sure you do an error check on that before attempting the update!

eg.

<cfif listlen(form.productid) eq listlen(form.price)>

PERFORM UPDATE

<cfelse>

ARGH! ... DO NOT UPDATE

</cfif>

and also remember that if a value is not passed, a list does not show a null value like this: 1,2,3,,,,7,8,9 (ie. with 9 values)... it will actually appear as 1,2,3,7,8,9 with only 6 values, so make sure you account for nulls somehow.

good luck!

steve

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, 15 June 2004 3:46 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: NEW batch style update request

Thank you...
this worked a treat.
will it be ok for 200 items?
<cfloop index="x" from="1" to="#listlen(form.productid)#" step="1">
 
<CFQUERY NAME="updateprice" DATASOURCE="#prefs.dsn#">
UPDATE     products
SET        unitprice= 
#listgetat(form.price,x)#
WHERE   productid = #listgetat(form.productid,x)#
</CFQUERY>

</cfloop>
 
 
 
 
Kind Regards
Greg Stone
PH: 0411 787 565
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to