The script that I developed using DBI and tested against our Oracle db is
now being run against an MSSQL db by our customer. The only difference
between the script running here and there is that the line setting up the db
connection went from
$DB_CONN = "DBI:Oracle:KOTA";
to
$DB_CONN = "DBI:ODBC:BandJdev";
It runs fine here, but the customer gets a whole bunch of error messages
like this--(I'll put the actual code after the error msgs):
D:\data\rmicftp.unilever.com\extracts\dev.benjerry.com\scripts>process_chunk
mail
.pl
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Line 1:
Incorrect syntax near '='. (SQL-42000)(DBD: Execute immediate failed
err=-1) at
D:\data\rmicftp.unilever.com\extracts\dev.benjerry.com\scripts\process_chunk
mail
.pl line 133.
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]The COMM
IT TRANSACTION request has no corresponding BEGIN TRANSACTION.
(SQL-25000)(DBD:
Execute immediate failed err=-1) at
D:\data\rmicftp.unilever.com\extracts\dev.be
njerry.com\scripts\process_chunkmail.pl line 135.
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Line 1:
Incorrect syntax near '='. (SQL-42000)(DBD: Execute immediate failed
err=-1) at
D:\data\rmicftp.unilever.com\extracts\dev.benjerry.com\scripts\process_chunk
mail
.pl line 133.
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]The COMM
IT TRANSACTION request has no corresponding BEGIN TRANSACTION.
(SQL-25000)(DBD:
Execute immediate failed err=-1) at
D:\data\rmicftp.unilever.com\extracts\dev.be
njerry.com\scripts\process_chunkmail.pl line 135.
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Line 1:
Incorrect syntax near '='. (SQL-42000)(DBD: Execute immediate failed
err=-1) at
D:\data\rmicftp.unilever.com\extracts\dev.benjerry.com\scripts\process_chunk
mail
.pl line 133.
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]The COMM
IT TRANSACTION request has no corresponding BEGIN TRANSACTION.
(SQL-25000)(DBD:
Execute immediate failed err=-1) at
D:\data\rmicftp.unilever.com\extracts\dev.be
njerry.com\scripts\process_chunkmail.pl line 135.
DBD::ODBC::db do failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Line 1:
Incorrect syntax near '='. (SQL-42000)(DBD: Execute immediate failed
err=-1) at
D:\data\rmicftp.unilever.com\extracts\dev.benjerry.com\scripts\process_chunk
mail
.pl line 133.
Here's what the first few lines of code look like. I suspect from the error
message that no more than this is needed to see what the problem is for
those experienced with MSSQL/SqlServer:
#process_chunkmail.pl
use DBI;
use Date::Manip;
if ($^O =~ m/(Win|32)/) {
Date_Init("TZ=EST"); # this one for Windows--for some reason the #
trick doesn't work
} else {
# automatically figures out if it's daylight time or not
Date_Init("TZ=EST#EDT");
};
$DB_CONN = "DBI:ODBC:BandJdev";
$DB_USER = "bj-dev";
$DB_PASS = "bjpass";
$add_test_to_fname = 1; #(Set this var to 0 to STOP adding
'TEST_' to output file names.)
$want_debug_msg = 0; #(Set this var to 1 to see debug
msgs in output file when testing)
Thank you.
Laurie A. Vien
Sr. Programmer/Analyst
Ben & Jerry's Homemade, Inc.