|
|
sybperl-l Archive
Up Prev Next
From: Ravi Parimi <rparimi at gmail dot com>
Subject: Segfault when running stored procedures using DBD::Sybase
Date: Jun 2 2005 1:09AM
Hi,
I have been able to invoke external stored on a remote SQL server
with perl using something similar to the following:
my $sql = <prepare($sql) || die "Can't prepare $sql : $DBI::errstr\n";
};
eval {
$sth->execute or die "Can't execute ${sql}: $DBI::errstr\n";
};
my ($code,$error) = $sth->syb_output_params();
For some bizzare reason, a call to syb_output_params() does not return
anything anymore.
Reading the perldoc for DBD::Sybase, I saw that there is yet another
way to run stored procedures. However, I get a segfault when I ran the
following:
my $sql = "exec master.dbo.load ?, ?, ?, ?";
print "SQL is\n$sql\n";
my $sth;
eval {
$sth = $dbh->prepare("exec msater.dbo.ing_bulk_load ?,?,?,?") || die
"Can't prepare $sql : $DBI::errstr\n";
};
if($@) {
return $@;
}
eval {
$sth->execute($job,$flag,$code,$mesg) or die "Can't execute ${sql}:
$DBI::errstr\n";
};
my (@data) = $sth->syb_output_params();
foreach (@data) {
print "err code = $_\n";
}
The prepare() works fine, but I get a segfault execute() is being
called. I tried passing arguments to execute() in single quotes, but
that didn't help either. Can someone show me the right way to do this?
Thanks,
--ravi
|