Hi, for the last 2 days I've been trying to get a simple connection to a
Sybase 11x server running on Linux. Here is the script:
<stript>
#!/usr/bin/perl -w
use strict;
use DBI;
my $dbh =
DBI->connect("dbi:Sybase:server=COCAINE;charset=cp850","survivor","b0rkb0rkb0rk",
{RaiseError => 1})
or die "Cannot connect: $DBI::errstr";
my $sth = $dbh->prepare("select 1")
or die "Cannot prepare: $DBI::errstr";
$dbh->disconnect();
exit 0;
</script>
As you can see, simple. This results in the following:
DBD::Sybase::db prepare failed: OpenClient message: LAYER = (1) ORIGIN =
(1) SEVERITY = (1) NUMBER = (49)
Server COCAINE, database
Message String: ct_send(): user api layer: external error: This routine
cannot be called because another command structure has results pending.
DBD::Sybase::db prepare failed: OpenClient message: LAYER = (1) ORIGIN =
(1) SEVERITY = (1) NUMBER = (49)
Server COCAINE, database
Message String: ct_send(): user api layer: external error: This routine
cannot be called because another command structure has results pending.
So, it appears the connection is failing, but why? Adding a commenting
out the prepare and adding a trace(2) retsults in:
[EMAIL PROTECTED]:~> clear; ./db2.pl
DBI 1.48-ithread default trace level set to 0x0/2 (pid 21507)
-> DBI->connect(dbi:Sybase:server=COCAINE;charset=cp850, survivor,
****, HASH(0x816cc20))
-> DBI->install_driver(Sybase) for linux perl=5.008006 pid=21507
ruid=1001 euid=1001
install_driver: DBD::Sybase version 1.05 loaded from
/usr/lib/perl5/site_perl/5.8.6/i586-linux-thread-multi/DBD/Sybase.pm
<- install_driver= DBI::dr=HASH(0x827a35c)
-> connect for DBD::Sybase::dr (DBI::dr=HASH(0x827a35c)~0x830f7bc
'server=COCAINE;charset=cp850' 'survivor' **** HASH(0x83110f0)) thr#816c008
<- connect= DBI::db=HASH(0x830f7b0) at DBI.pm line 598
-> STORE for DBD::Sybase::db (DBI::db=HASH(0x83110e4)~INNER
'RaiseError' 1) thr#816c008
ERROR: 159 'OpenClient message: LAYER = (1) ORIGIN = (4) SEVERITY
= (1) NUMBER = (132)
Server COCAINE, database
Message String: ct_fetch(): user api layer: internal common library
error: The bind of result set item 1 resulted in truncation.
OpenClient message: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (163)
Server COCAINE, database
Message String: ct_results(): user api layer: external error: Th...' (err#0)
<- STORE= 1 at DBI.pm line 645
-> STORE for DBD::Sybase::db (DBI::db=HASH(0x83110e4)~INNER
'PrintError' 1) thr#816c008
ERROR: 159 'OpenClient message: LAYER = (1) ORIGIN = (4) SEVERITY
= (1) NUMBER = (132)
Server COCAINE, database
Message String: ct_fetch(): user api layer: internal common library
error: The bind of result set item 1 resulted in truncation.
OpenClient message: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (163)
Server COCAINE, database
Message String: ct_results(): user api layer: external error: Th...' (err#0)
<- STORE= 1 at DBI.pm line 645
-> STORE for DBD::Sybase::db (DBI::db=HASH(0x83110e4)~INNER
'AutoCommit' 1) thr#816c008
ERROR: 159 'OpenClient message: LAYER = (1) ORIGIN = (4) SEVERITY
= (1) NUMBER = (132)
Server COCAINE, database
Message String: ct_fetch(): user api layer: internal common library
error: The bind of result set item 1 resulted in truncation.
OpenClient message: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (163)
Server COCAINE, database
Message String: ct_results(): user api layer: external error: Th...' (err#0)
<- STORE= 1 at DBI.pm line 645
-> STORE for DBD::Sybase::db (DBI::db=HASH(0x83110e4)~INNER
'Username' 'survivor') thr#816c008
ERROR: 159 'OpenClient message: LAYER = (1) ORIGIN = (4) SEVERITY
= (1) NUMBER = (132)
Server COCAINE, database
Message String: ct_fetch(): user api layer: internal common library
error: The bind of result set item 1 resulted in truncation.
OpenClient message: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (163)
Server COCAINE, database
Message String: ct_results(): user api layer: external error: Th...' (err#0)
<- STORE= 1 at DBI.pm line 648
ERROR: 159 'OpenClient message: LAYER = (1) ORIGIN = (4) SEVERITY
= (1) NUMBER = (132)
Server COCAINE, database
Message String: ct_fetch(): user api layer: internal common library
error: The bind of result set item 1 resulted in truncation.
OpenClient message: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (163)
Server COCAINE, database
Message String: ct_results(): user api layer: external error: Th...' (err#0)
<> FETCH= 'survivor' ('Username' from cache) at DBI.pm line 648
<- connect= DBI::db=HASH(0x830f7b0)
-> STORE for DBD::Sybase::db (DBI::db=HASH(0x83110e4)~INNER
'dbi_connect_closure' CODE(0x830f900)) thr#816c008
ERROR: 159 'OpenClient message: LAYER = (1) ORIGIN = (4) SEVERITY
= (1) NUMBER = (132)
Server COCAINE, database
Message String: ct_fetch(): user api layer: internal common library
error: The bind of result set item 1 resulted in truncation.
OpenClient message: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (163)
Server COCAINE, database
Message String: ct_results(): user api layer: external error: Th...' (err#0)
<- STORE= 1 at DBI.pm line 668
-> disconnect for DBD::Sybase::db
(DBI::db=HASH(0x830f7b0)~0x83110e4) thr#816c008
<- disconnect= 1 at db2.pl line 14
-> DESTROY for DBD::Sybase::db (DBI::db=HASH(0x83110e4)~INNER)
thr#816c008
<- DESTROY= undef
-- DBI::END
-> disconnect_all for DBD::Sybase::dr
(DBI::dr=HASH(0x827a35c)~0x830f7bc) thr#816c008
<- disconnect_all= 1 at DBI.pm line 677
! -> DESTROY in DBD::_::common for DBD::Sybase::dr
(DBI::dr=HASH(0x830f7bc)~INNER) thr#816c008
! <- DESTROY= undef during global destruction
$
Any ideas, Google and I a fresh out.
David