Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Help with SQL / ColdFusion "update"

Thread Tools
 
Search this Thread
 
Old 09 May 2002, 05:12 PM
  #1  
RichB
Scooby Regular
Thread Starter
 
RichB's Avatar
 
Join Date: Apr 1999
Location: Bore Knee Muff
Posts: 3,666
Likes: 0
Received 0 Likes on 0 Posts
Post

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]
Old 09 May 2002, 05:23 PM
  #2  
Darren (M3)
Scooby Regular
 
Darren (M3)'s Avatar
 
Join Date: Jun 2002
Posts: 194
Likes: 0
Received 0 Likes on 0 Posts
Post

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]
Old 05 September 2002, 04:30 PM
  #3  
Darren (M3)
Scooby Regular
 
Darren (M3)'s Avatar
 
Join Date: Jun 2002
Posts: 194
Likes: 0
Received 0 Likes on 0 Posts
Post

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
Old 06 September 2002, 09:47 AM
  #4  
RichB
Scooby Regular
Thread Starter
 
RichB's Avatar
 
Join Date: Apr 1999
Location: Bore Knee Muff
Posts: 3,666
Likes: 0
Received 0 Likes on 0 Posts
Post

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
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Brett-wv14
Subaru
17
06 October 2015 09:03 PM
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



Quick Reply: Help with SQL / ColdFusion "update"



All times are GMT +1. The time now is 09:36 PM.