From c5ea053b9888bbe1879ff2941104d1dbb4554bf8 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Tue, 23 Jan 2018 14:05:02 -0500 Subject: RT# 76398 - fixed sybase query for detecting tables and adding columns --- FS/FS/cdr/Import.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/FS/FS/cdr/Import.pm b/FS/FS/cdr/Import.pm index 6f5062d9e..7582043b7 100644 --- a/FS/FS/cdr/Import.pm +++ b/FS/FS/cdr/Import.pm @@ -200,9 +200,7 @@ sub get_queries { #Check for freeside status table Sybase has not been tested my %dbi_check_statustable = ( - 'Sybase' => "SELECT systables.name FROM sysobjects - JOIN systables ON sysobjects.id = systables.id - WHERE sysobjects.name LIKE '$info->{table}' AND systables.name = $info->{status_table}", + 'Sybase' => "SELECT * FROM sysobjects WHERE name = $info->{status_table}", 'Pg' => "SELECT * FROM information_schema.columns WHERE table_schema = 'public' AND table_name = '$info->{status_table}' AND column_name = '$info->{status_column}'", ); @@ -222,7 +220,7 @@ sub get_queries { #Check for freeside status column Sybase has not been tested my %dbi_create_statuscolumn = ( - 'Sybase' => "ALTER TABLE $info->{table} ADD COLUMN $info->{status_column} $info->{status_column_info}", + 'Sybase' => "ALTER TABLE $info->{table} ADD $info->{status_column} $info->{status_column_info}", 'Pg' => "ALTER TABLE $info->{table} ADD COLUMN $info->{status_column} $info->{status_column_info}", ); -- cgit v1.2.1