in reply to Perl/MySQL table data copy
You're very close:
Of course, I assume those values you mentioned were good to go in, and wouldn't cause it to clear or override defaults in the table (if it would, then you'll want to specify which fields you're inserting into by name, which takes a bit more work).
Mysql also specifically has a INSERT...SELECTsyntax that's supposed to correctly handle autonumber fields:
INSERT INTO `$db`.`$table` SELECT '', 'author', '',* FROM `$db`.`$oldtable`
Update: dragonchild is right. I need to stop giving Oracle answers for mysql questions. (blah...lack of subqueries)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl/MySQL table data copy
by dragonchild (Archbishop) on Mar 31, 2005 at 13:25 UTC | |
|
Re^2: Perl/MySQL table data copy
by rsiedl (Friar) on Mar 31, 2005 at 14:46 UTC | |
by bpphillips (Friar) on Mar 31, 2005 at 16:14 UTC | |
by jhourcle (Prior) on Mar 31, 2005 at 15:39 UTC | |
by bpphillips (Friar) on Mar 31, 2005 at 16:26 UTC |