Page 1 of 1

Is there a fast portable way I can copy a row to a new one when having auto-increment?

Posted: Wed 07 May 2008 08:04
by gandalf1024
I was wondering if there is a fast way I could insert a new row in a table by copying all the columns except one (a unique auto-increment column) from another row.
I could explicitly set each column, of course, but there are over 30 columns in this table and it is constantly changing to reflect new values I want to hold, so this will introduce a bug somewhere in the future.
I don't know if MySQL or MYDAC has a way of doing this. I'm using MyDAC version 5.00.1.6

Thanx in advance

Posted: Thu 08 May 2008 11:13
by Dimon
MySQL does not give a fast way to copy all the columns except one from one row to another. You should explicitly set each column.
Also you can use INSERT ... SELECT statement or default values of fields.
You can find more detailed information about this in MySQL Reference Manual.