Diff for scripts/perl/mysql/mysql-table-copy.pl between version 1.1 and 1.2
| version 1.1, 2003/11/07 08:42:49 |
version 1.2, 2003/12/16 18:16:49 |
|
|
| # Licensed under terms of GNU General Public License. |
# Licensed under terms of GNU General Public License. |
| # All rights reserved. |
# All rights reserved. |
| # |
# |
| # $Platon: $ |
# $Platon: scripts/perl/mysql/mysql-table-copy.pl,v 1.1 2003/11/07 08:42:49 rajo Exp $ |
| |
|
| # TODO: - reconnect on closed connection |
# TODO: - reconnect on closed connection |
| # - managment for tables with multiple KEY columns |
# - managment for tables with multiple KEY columns |
|
|
| $sql_read_data->execute() or warn $dbh1->errstr; |
$sql_read_data->execute() or warn $dbh1->errstr; |
| while (my @row = $sql_read_data->fetchrow_array()) { |
while (my @row = $sql_read_data->fetchrow_array()) { |
| my $prim_key = shift @row; # cut PRIMARY KEY column, which is not inserted |
my $prim_key = shift @row; # cut PRIMARY KEY column, which is not inserted |
| +++ /etc/updatedb.conf.dpkg-new |
|
| if ($sql_write_data->execute(@row)) { |
if ($sql_write_data->execute(@row)) { |
| print cur_date(), "\tData with key '$prim_key' succesfully inserted with key ", $dbh2->{"mysql_insertid"}, "\n"; |
print cur_date(), "\tData with key '$prim_key' succesfully inserted with key ", $dbh2->{"mysql_insertid"}, "\n"; |
| $sql_delete_data->execute($prim_key) or warn cur_date(), "\tError removing data with key '$prim_key': ", |
$sql_delete_data->execute($prim_key) or warn cur_date(), "\tError removing data with key '$prim_key': ", |
Platon Group <platon@platon.org> http://platon.org/
|
|