macromedia.coldfusion.database_access
[Top] [All Lists]

Update table 1 with data from Table 2?

Subject: Update table 1 with data from Table 2?
From: "newportri" <webforumsuser@xxxxxxxxxxxxxx>
Date: Mon, 28 Jul 2008 17:09:16 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

Ok I successfully populated my new table with data from another table.

 Now, I need to add additional data to the new (multiple) records  (UPDATE)  
from yet another table.

 I know how to kick off an update action for one record using a passed key 
field from a form or link (URL), but I keep getting syntax errors trying to 
complete the data transfer with:

 <cfquery name="updatedata" datasource="somedata">
 UPDATE new_table
 FROM old_table
 SET vendor_address1 = "Street1",
        vendor_address2 = "Street2",
        vendor_city = "City",
        vendor_state = "StateID",
        vendor_zip = "Zip",
        vendor_zip4 = "Zip4",
        vendor_tele = "Phone",
        vendor_fax = "Fax"

 WHERE old_location_ID = "PhysicalLocationID"

 </cfquery>

 I've tried several variations of this- sorry but what am I missing?

 Thanks in advance.

 newportri


<Prev in Thread] Current Thread [Next in Thread>