Help with SQL / ColdFusion "update"
#1
Scooby Regular
Thread Starter
Join Date: Apr 1999
Location: Bore Knee Muff
Posts: 3,666
Likes: 0
Received 0 Likes
on
0 Posts
From our CF developer....
you should be able to use
SET qty = '#form['form_qty_' & row_id]#'
unless you're using an old version of CF in which case you'll need:
SET qty = '#evaluate('form.form_qty_' & row_id)#'
Hope that helps....
Rich (Need CF hosting ? )
[Edited by RichB - 9/5/2002 5:17:05 PM]
you should be able to use
SET qty = '#form['form_qty_' & row_id]#'
unless you're using an old version of CF in which case you'll need:
SET qty = '#evaluate('form.form_qty_' & row_id)#'
Hope that helps....
Rich (Need CF hosting ? )
[Edited by RichB - 9/5/2002 5:17:05 PM]
#2
Ok, I've checked out your code and its doesn't seem to work. Its rejecting the line:
SET qty = '#form['form_qty_' & row_id]#'
I've even played around with this and its rejecting:
SET qty = '#['form_qty_88']#'
Which IS a valid variable name - I can output via <cfoutput>#form_qty_88#</cfoutput>
I'll try that backup line you mentioned to see if that works. I AM using ColdFusion MX though.
[Edited by Darren (M3) - 9/5/2002 5:47:18 PM]
SET qty = '#form['form_qty_' & row_id]#'
I've even played around with this and its rejecting:
SET qty = '#['form_qty_88']#'
Which IS a valid variable name - I can output via <cfoutput>#form_qty_88#</cfoutput>
I'll try that backup line you mentioned to see if that works. I AM using ColdFusion MX though.
[Edited by Darren (M3) - 9/5/2002 5:47:18 PM]
#3
I have several rows in table, each with a quanity in an input box.
I wanted to give each qty box in the table, a unique name to reference it by.
So, each qty box was given the name form_qty_#row_ID# (where row_ID is a coldfusion variable representing the row number in the table)
form_qty_1
form_qty_2
form_qty_3
etc...
I need to use an update to get the contents of these variables into the database, but the semantics of the update clause are frustrating me...
update query_orders
set qty =
where customer_ID like '%#currentUserID#%'
My question is - how do I represent my variable for the set qty line above ?
eg. is it something like...
set qty = '%#form_qty_#row_ID#%'
Its more of a Cold Fusion developers question than a pure SQL question as it needs some experience dealing with how coldfusion represents and concatenates its strings, etc...
Any help would be greatly appreciated
-DV
I wanted to give each qty box in the table, a unique name to reference it by.
So, each qty box was given the name form_qty_#row_ID# (where row_ID is a coldfusion variable representing the row number in the table)
form_qty_1
form_qty_2
form_qty_3
etc...
I need to use an update to get the contents of these variables into the database, but the semantics of the update clause are frustrating me...
update query_orders
set qty =
where customer_ID like '%#currentUserID#%'
My question is - how do I represent my variable for the set qty line above ?
eg. is it something like...
set qty = '%#form_qty_#row_ID#%'
Its more of a Cold Fusion developers question than a pure SQL question as it needs some experience dealing with how coldfusion represents and concatenates its strings, etc...
Any help would be greatly appreciated
-DV
#4
Scooby Regular
Thread Starter
Join Date: Apr 1999
Location: Bore Knee Muff
Posts: 3,666
Likes: 0
Received 0 Likes
on
0 Posts
Darren,
The short answer is this:
If he's using CFMX then form['form_qty_' & row_id] WILL work.
The longer answer is in your mail box...
RB
The short answer is this:
If he's using CFMX then form['form_qty_' & row_id] WILL work.
The longer answer is in your mail box...
RB
Thread
Thread Starter
Forum
Replies
Last Post
An0n0m0us
Computer & Technology Related
0
28 September 2015 09:58 PM
MightyArsenal
Wheels, Tyres & Brakes
6
25 September 2015 08:31 PM
JackClark
Computer & Technology Related
3
18 September 2015 11:19 PM