|
|
sybperl-l Archive
Up Prev Next
From: KERTEL - Maxime MARAIS <mmarais at kertel dot com>
Subject: [DBD::Sybase] Prepare = Segmentation fault
Date: May 31 2006 1:21PM
Hello,
After searching for a while on Google, I am still not able to find an
answer to the following issue. Running $dbh->prepare($sql) fails because
of a segmentation fault. I don't manage to fix this issue. Any idea
about this would be welcome.
Code sample :
#!/usr/bin/perl -w
use DBI;
my $name = "user";
my $pass = "pass";
my $conn = 'DBI:Sybase:server=monserver';
my $dbh = DBI->connect($conn, $name, $pass);
print "W0 - Preparing\n";
my $sth = $dbh->prepare("SELECT ISDATE(?)");
# Note I use a parameter '?' in the sql query.
print "W0 - Executing\n";
$sth->execute('1970-01-01');
Run :
$ ./test.pl
W0 - Preparing
ct_send(CS_DESCRIBE_INPUT) returned 0 at
/usr/local/lib/perl/5.8.7/DBD/Sybase.pm line 133.
Erreur de segmentation
Environnement :
Perl v5.8.7
DBI::DBD v11.21
DBD::Sybase V1.07
FreeTDS V0.63
Note 1 : if you replace the 3 last lines with the following code,
everything works fine.
my $sth = $dbh->prepare("SELECT ISDATE('1970-01-01')");
print "W0 - Executing\n";
$sth->execute();
Note 2 : adapting the code to be run on Windows with ActivePerl + ODBC +
Windows MS SQL Driver, the $dbh->prepare("SELECT ISDATE(?)") and
$sth->execute('1970-01-01') statements work fine.
Many thanks forward for your help.
--
Maxime MARAIS
Kertel.
|