Greg,
Will this update SQL allow you to record the un-checking featured, special
and hiddenprod boxes?
I think you would need to set featured etc to 1 if the form field was
defined and 0 otherwise.
i.e.
<cfif isDefined("Form.Featured_#p#")>, Featured=1</cfif>
to
, Featured=<cfif isDefined("Form.Featured_#p#")>1<cfelse>0</cfif>
cheers
David
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, 16 June 2004 9:29 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: NEW batch style update request
Hi steve.
found your snipet and now i understand the method... very clever..
i did think of that idea just couldnt work out how to match up on the
process page.
now i know the trick... thank you
now to get it working , i am getting a really basic error on the update
query and cant seem to track where the problem might be.
heres the update query
<cfif isdefined("form.updateprice")>
<cfloop list="#Form.ProductIDs#" index="p">
<CFQUERY NAME="updateprice" DATASOURCE="#prefs.dsn#">
UPDATE products
set unitprice = #Form["price_#p#"]#
<cfif isDefined("Form.Featured_#p#")>, Featured=1</cfif>
<cfif isDefined("Form.special_#p#")>,special=1</cfif>
<cfif isDefined("Form.hiddenprod_#p#")>,hiddenprod=1</cfif>
WHERE productid = #p#
</CFQUERY>
</cfloop>
</cfif>
The error
ODBC Error Code = 22005 (Error in assignment)
[Mirosoft][ODBC Microsoft Access Driver] Data type mismatch in criteria
expression.
SQL = "UPDATE products set unitprice = 2.0 ,special=1 ,hiddenprod=1 WHERE
productid = 1"
Kind Regards
Greg Stone
PH: 0411 787 565
----- Original Message -----
From: Steve Onnis
To: CFAussie Mailing List
Sent: Tuesday, June 15, 2004 5:49 PM
Subject: [cfaussie] RE: NEW batch style update request
Greg
the code i sent would update it all at once, in the same update statement
check back through it
Steve
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, June 15, 2004 5:23 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: NEW batch style update request
Oppps.
what did i miss.
i got so confused on which one to work with and thought your snipet was the
sweetest for the update price function.
for the checkbox i came up with what i thought was a elegant solution.
This was the most functional for price update ..YES or NO?
<cfloop index="x" from="1" to="#listlen(form.productpartno)#" step="1">
<CFQUERY NAME="updateprice" DATASOURCE="#prefs.dsn#">
UPDATE products
SET unitprice= #listgetat(form.price,x)#
WHERE productpartno = '#listgetat(form.productpartno,x)#'
</CFQUERY>
</cfloop>
as for the check boxes i cant think of a way to check if they are ticked or
not.
HMMMM
it works...... but .... back to the drawing board or ....???
Kind Regards
Greg Stone
PH: 0411 787 565
----- Original Message -----
From: Steve Onnis
To: CFAussie Mailing List
Sent: Tuesday, June 15, 2004 5:18 PM
Subject: [cfaussie] RE: NEW batch style update request
Sorry greg
but thats sooooooooooooooooooooo yuk
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, June 15, 2004 4:39 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: NEW batch style update request
Hi
for all those who contributed i settled on these updates.
<!--- loop over selected fields and update table --->
<cfif isdefined("form.featured")>
<cfloop index='item' list='#form.featured#' delimiters=','>
<CFQUERY NAME="updatefeatured" datasource="#prefs.dsn#" >
UPDATE products
SET featured=1
WHERE (productid = '#item#')
</CFQUERY>
</cfloop>
</cfif>
<cfif isdefined("form.special")>
<cfloop index='item' list='#form.special#' delimiters=','>
<CFQUERY NAME="updatespecial" datasource="#prefs.dsn#" >
UPDATE products
SET special=1
WHERE (productid = '#item#')
</CFQUERY>
</cfloop>
</cfif>
<cfif isdefined("form.hiddenprod")>
<cfloop index='item' list='#form.hiddenprod#' delimiters=','>
<CFQUERY NAME="updatehiddenprod" DATASOURCE="#prefs.dsn#">
UPDATE products
SET hiddenprod=1
WHERE (productid = '#item#')
</CFQUERY>
</cfloop>
</cfif>
<cfloop index="x" from="1" to="#listlen(form.productpartno)#" step="1">
<CFQUERY NAME="updateprice" DATASOURCE="#prefs.dsn#">
UPDATE products
SET unitprice= #listgetat(form.price,x)#
WHERE productpartno = '#listgetat(form.productpartno,x)#'
</CFQUERY>
</cfloop>
regards greg
----- Original Message -----
From: Steve Onnis
To: CFAussie Mailing List
Sent: Tuesday, June 15, 2004 4:29 PM
Subject: [cfaussie] RE: NEW batch style update request
I would recommend against this method
Not very efficient and your going to run into problems especially as your
dealing with checkboxes aswell which unless they are checked wont get passed
with your form and thus wont be available in your list, not to mention is i
check one of the boxes, trying to work out which one actually got checked
would be a nightmare
Steve
---
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/ ---
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/
---
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/ ---
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/
---
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/ ---
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/
---
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/
---
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/