Segfault when running stored procedures using DBD::Sybase

Ravi Parimi <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
Hi,

 I have been able to invoke external stored on a remote SQL server
with perl using something similar to the following:

my $sql = <<SQL;
	declare \@exit_rc int, \@exit_text varchar(2000);
exec master.dbo.load '$job', '$flag', \@exit_rc output, \@exit_text output;
SQL 
	print "SQL is\n$sql\n";
	my $sth;
	eval {
		$sth = $dbh->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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.