This commit is contained in:
2017-09-18 23:38:51 +02:00
parent feaf1de078
commit b4769aac87

View File

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