PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: "Wechsler, Steven" <Steven dot Wechsler at mtvstaff dot com>
Subject: Problem with DBD::Sybase and SQL Server
Date: Oct 30 2008 8:16PM

I have two hosts here. They are both using FreeTDS to talk to a SQL
Server. One is running DBD::Sybase v 0.95, and it works fine. The other
is running v 1.08, and it gets the following error whenever I try to run
any SQL command:

$ run_sql.pl -S mtvu-sql-1 -q 'select @@servername'
Msg 3902, Severity 16, State 1:
Server 'MTVU-SQL-1', Line: 2:
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.
***** Running query against server mtvu-sql-1 at 10/30/08 15:57:36 *****
COL(1)
---------- 
MTVU-SQL-1 
***** WARNING: Execution finished with warnings/errors at 10/30/08
15:57:36 ****

The TDS version is the same on both. Here is a trace for the working
host:

$ DBI_TRACE=1 run_sql.pl -S mtvu-sql-1 -q 'select @@servername'
    DBI 1.604-ithread default trace level set to 0x0/1 (pid 13360) at
DBI.pm line 273 via run_sql.pl line 62
    -> DBI->connect(dbi:Sybase:server=mtvu-sql-1, sa, ****,
HASH(0x91da1b4))
    -> DBI->install_driver(Sybase) for linux perl=5.008 pid=13360
ruid=30905 euid=30905
       install_driver: DBD::Sybase version 0.95 loaded from
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/DBD/Sybase.pm
    <- install_driver= DBI::dr=HASH(0x920b678)
    !! warn: 0 CLEARED by call to connect method
    <- connect('server=mtvu-sql-1', 'sa', ...)= DBI::db=HASH(0x920c01c)
at DBI.pm line 637
    <- STORE('PrintError', 1)= 1 at DBI.pm line 689
    <- STORE('AutoCommit', 1)= 1 at DBI.pm line 689
    <- STORE('Username', 'sa')= 1 at DBI.pm line 692
    <> FETCH('Username')= 'sa' ('Username' from cache) at DBI.pm line
692
    <- STORE('syb_err_handler', CODE(0x91d1ff4))= 1 at DBI.pm line 692
    <- FETCH('syb_err_handler')= CODE(0x91d1ff4) at DBI.pm line 692
    <- connected('dbi:Sybase:server=mtvu-sql-1', 'sa', ...)= undef at
DBI.pm line 698
    <- connect= DBI::db=HASH(0x920c01c)
    <- STORE('dbi_connect_closure', CODE(0x920a2d8))= 1 at DBI.pm line
707
    <- prepare('select db_name()')= DBI::st=HASH(0x920c1cc) at
run_sql.pl line 1187
    <- execute= -1 at run_sql.pl line 1189
    <- fetchrow_array= ( 'master' ) [1 items] row1 at run_sql.pl line
1190
    <- DESTROY(DBI::st=HASH(920c0a0))= undef at run_sql.pl line 460
***** Running query against server mtvu-sql-1 at 10/30/08 15:59:00 *****
    <- prepare("select @@servername

-- ")= DBI::st=HASH(0x8fb48a8) at run_sql.pl line 557
    <- execute= -1 at run_sql.pl line 561
    <- rows= -1 at run_sql.pl line 562
    <- FETCH('NUM_OF_FIELDS')= 1 at run_sql.pl line 574
    <- FETCH('NAME')= [ 'COL(1)' ] at run_sql.pl line 578
    <- FETCH('syb_result_type')= 4040 at run_sql.pl line 584
    <- FETCH('NUM_OF_FIELDS')= 1 at run_sql.pl line 585
COL(1)
---------- 
MTVU-SQL-1 
    <- more_results= undef at run_sql.pl line 724
    <- FETCH('syb_more_results')= 0 at run_sql.pl line 575
    <- finish= 1 at run_sql.pl line 760
    <- disconnect= 1 at run_sql.pl line 761
***** Execution finished at 10/30/08 15:59:00 *****
    <- disconnect= 1 at run_sql.pl line 941
    <- disconnect_all= 1 at DBI.pm line 716
!   <- DESTROY(DBI::st=HASH(8fb48a8))= undef during global destruction
!   <- DESTROY(DBI::db=HASH(920b9c0))= undef during global destruction
!   <- DESTROY(DBI::dr=HASH(920b6e4))= undef during global destruction

And here is the trace for the one that gets the error:

$ DBI_TRACE=1 run_sql.pl -S mtvu-sql-1 -q 'select @@servername'
    DBI 1.604-ithread default trace level set to 0x0/1 (pid 13360) at
DBI.pm line 273 via run_sql.pl line 62    DBI 1.602-ithread default
trace level set to 0x0/1 (pid 17240) at DBI.pm line 273 via run_sql.pl
line 62
    -> DBI->connect(dbi:Sybase:server=mtvu-sql-1, sa, ****,
HASH(0x85bbd10))
    -> DBI->install_driver(Sybase) for linux perl=5.008005 pid=17240
ruid=2001 euid=2001
       install_driver: DBD::Sybase version 1.08 loaded from
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/DBD/Sybase.pm
    <- install_driver= DBI::dr=HASH(0x85fd480)
    !! warn: 0 CLEARED by call to connect method
    <- connect('server=mtvu-sql-1', 'sa', ...)= DBI::db=HASH(0x85ff5f8)
at DBI.pm line 637
    <- STORE('PrintError', 1)= 1 at DBI.pm line 689
Msg 3902, Severity 16, State 1:
Server 'MTVU-SQL-1', Line: 2:
The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.
    <- STORE('AutoCommit', 1)= 1 at DBI.pm line 689
    <- STORE('Username', 'sa')= 1 at DBI.pm line 692
    <> FETCH('Username')= 'sa' ('Username' from cache) at DBI.pm line
692
    <- STORE('syb_err_handler', CODE(0x85b4358))= 1 at DBI.pm line 692
    <- FETCH('syb_err_handler')= CODE(0x85b4358) at DBI.pm line 692
    <- connected('dbi:Sybase:server=mtvu-sql-1', 'sa', ...)= undef at
DBI.pm line 698
    <- connect= DBI::db=HASH(0x85ff5f8)
    <- STORE('dbi_connect_closure', CODE(0x85fdec8))= 1 at DBI.pm line
707
    <- prepare('select db_name()')= DBI::st=HASH(0x85ff79c) at
run_sql.pl line 1187
    <- execute= -1 at run_sql.pl line 1189
    <- fetchrow_array= ( 'master' ) [1 items] row1 at run_sql.pl line
1190
    <- DESTROY(DBI::st=HASH(85ff67c))= undef at run_sql.pl line 460
***** Running query against server mtvu-sql-1 at 10/30/08 15:59:11 *****
    <- prepare('select @@servername

-- ')= DBI::st=HASH(0x8352b88) at run_sql.pl line 557
    <- execute= -1 at run_sql.pl line 561
    <- rows= -1 at run_sql.pl line 562
    <> FETCH('NUM_OF_FIELDS')= 1 ('NUM_OF_FIELDS' from cache) at
run_sql.pl line 574
    <- FETCH('NAME')= [ 'COL(1)' ] at run_sql.pl line 578
    <- FETCH('syb_result_type')= 4040 at run_sql.pl line 584
    <> FETCH('NUM_OF_FIELDS')= 1 ('NUM_OF_FIELDS' from cache) at
run_sql.pl line 585
COL(1)
---------- 
MTVU-SQL-1 
    <- more_results= undef at run_sql.pl line 724
    <- FETCH('syb_more_results')= 0 at run_sql.pl line 575
    <- finish= 1 at run_sql.pl line 760
    <- disconnect= 1 at run_sql.pl line 761
***** WARNING: Execution finished with warnings/errors at 10/30/08
15:59:11 ****
    <- disconnect= 1 at run_sql.pl line 941
    <- disconnect_all= 1 at DBI.pm line 716
!   <- DESTROY(DBI::st=HASH(8352b88))= undef during global destruction
!   <- DESTROY(DBI::db=HASH(85fe294))= undef during global destruction
!   <- DESTROY(DBI::dr=HASH(85fd4c8))= undef during global destruction


Steve Wechsler | steven.wechsler@mtvstaff.com
Sybase/SQL Server/MySQL Database Administrator
212-846-5683

MTV Networks