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

Literal strings vs values in INSERT SELECT?

Subject: Literal strings vs values in INSERT SELECT?
From: "newportri" <webforumsuser@xxxxxxxxxxxxxx>
Date: Mon, 28 Jul 2008 14:54:14 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

Greetings

 Probably missing something basic here, but I'm trying to move all the data 
from an old table to a new one using

 <cfquery name="insertdata" datasource="somedatasource">
 INSERT INTO vendor_new
 (old_vendor_ID, vendor_company, vendor_dba, vendor_url, vendor_admin_ID, 
old_location_ID, old_comment, old_billing_ID)
      
         SELECT vendor_ID, 'company_name', 'DBA_name', 'web_URL', AdminID, 
PhysicalLocationID, 'Comment', BillingLocationID
      FROM vendor_old
        
 </cfquery>

 In the DB, I get:

 vendor_ID      old_vendor_ID   vendor_company  vendor_url      vendor_dba      
etc.

 A senior moment?

 I also plan to move all the data in another table (call it table 3) to 
"vendors_new" (call it table 1) after I accomplish step 1 (moving all data from 
2 to 1) - IOW combining all the records from 2 tables into one new table.

 Thanks!


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