From 700afdbbb4f9f34d9fa12b02ba68aedb07075144 Mon Sep 17 00:00:00 2001 From: battilo Date: Tue, 19 Sep 2017 00:07:33 +0200 Subject: [PATCH] copy db --- SetupNewComp.pl | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/SetupNewComp.pl b/SetupNewComp.pl index dbeb488..5369465 100755 --- a/SetupNewComp.pl +++ b/SetupNewComp.pl @@ -200,7 +200,9 @@ sub setCompanyDBTables() { or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; $sth_db->finish; - my $sth_tb = $dbh->prepare( "SHOW TABLES FROM " . $db_adm . ";" ) + my $sth_tb = + $dbh->prepare( + "SHOW FULL TABLES IN " . $db_adm . " WHERE Table_Type = 'BASE TABLE';" ) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; $sth_tb->execute() or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; @@ -216,9 +218,15 @@ sub setCompanyDBTables() { . $db_adm . "." . $table->[0] . ";" ) - or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; + or die getTimeStamp("log") + . " - pid $$ " + . $table->[0] + . " >> $DBI::errstr"; $sth_deft->execute() - or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; + or die getTimeStamp("log") + . " - pid $$ " + . $table->[0] + . " >> $DBI::errstr"; $sth_deft->finish; if ( $table->[0] ne 'ELABDATADISP' and $table->[0] ne 'RAWDATACOR' ) { my $sth_cpyt = @@ -229,9 +237,15 @@ sub setCompanyDBTables() { . $db_adm . "." . $table->[0] . ";" ) - or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; + or die getTimeStamp("log") + . " - pid $$ " + . $table->[0] + . " >> $DBI::errstr"; $sth_cpyt->execute() - or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; + or die getTimeStamp("log") + . " - pid $$ " + . $table->[0] + . " >> $DBI::errstr"; $sth_cpyt->finish; }