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()