New topic: 

Insert from temp table with id

<http://forums.realsoftware.com/viewtopic.php?t=45853>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        neonash7777          Post subject: Insert from temp table with 
idPosted: Thu Nov 08, 2012 2:47 pm                         
Joined: Mon Nov 29, 2010 7:01 pm
Posts: 304                I have a payments table and a tempPayments table.

I create the temporary table with
CREATE TEMPORARY TABLE `tempPayments` LIKE `Payments`

This why it matches the schema. Now I want to update the payments table to add 
all the payments in the tempPayments table. I should be able to do something 
like:

INSERT INTO `Payments` SELECT `tempPayments`

The problem is the auto-increment Id field. All the fields line up but I need 
the auto-increment one to be ignored and get its new Id.
I don't want to manually list out the fields as they occasionally change and I 
don't want to have to update my code.

What's the proper way to get around this?   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to