From b4769aac87fa86d36944614dbbda359b0864b555 Mon Sep 17 00:00:00 2001 From: battilo Date: Mon, 18 Sep 2017 23:38:51 +0200 Subject: [PATCH] aa --- SetupNewComp.pl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/SetupNewComp.pl b/SetupNewComp.pl index 9582943..dbeb488 100755 --- a/SetupNewComp.pl +++ b/SetupNewComp.pl @@ -205,28 +205,29 @@ sub setCompanyDBTables() { $sth_tb->execute() or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; - my $tables_list = $sth_tb->fetchall_arrayref( {} ); + my $tables_list = $sth_tb->fetchall_arrayref; + foreach my $table ( @{$tables_list} ) { my $sth_deft = - $dbh->prepare( "CREATE TSBLE IF NOT EXISTS " + $dbh->prepare( "CREATE TABLE IF NOT EXISTS " . $company_db_name . "." - . $table + . $table->[0] . " LIKE " . $db_adm . "." - . $table + . $table->[0] . ";" ) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; $sth_deft->execute() or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; $sth_deft->finish; - if ( $table ne 'ELABDATADISP' and $table ne 'RAWDATACOR' ) { + if ( $table->[0] ne 'ELABDATADISP' and $table->[0] ne 'RAWDATACOR' ) { my $sth_cpyt = $dbh->prepare( "INSERT " . $company_db_name . "." - . $table + . $table->[0] . " SELECT * FROM " . $db_adm . "." - . $table + . $table->[0] . ";" ) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr"; $sth_cpyt->execute()