rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
But dont know how to do the above for tables that dont match up. I could pull each value from each column and manually create the insert for the new table, but its a big table and was hoping there would be an easier way...my $sth = $dbh->prepare("insert into $table select * from $oldtable");
Can anyone help me out?INSERT INTO `$db`.`$table` VALUES ( '', 'author', '', SELECT * FROM `$ +db`.`$oldtable` )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl/MySQL table data copy
by g0n (Priest) on Mar 31, 2005 at 08:40 UTC | |
|
Re: Perl/MySQL table data copy
by jhourcle (Prior) on Mar 31, 2005 at 12:05 UTC | |
by dragonchild (Archbishop) on Mar 31, 2005 at 13:25 UTC | |
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 |