SPUG: Trouble with DBD::Sybase
dleonard@dleonard.net
dleonard at dleonard.net
Tue May 31 15:25:47 PDT 2005
On Mon, 30 May 2005, Brian Hatch wrote:
> Anyone use DBD::Sybase to talk to a MS SQL server and call
> stored procedures with bind parameters? When I do this
>
> $sth = $dbh->prepare('exec proc_name \@p1 = ?, \@p2 = ?');
> $sth->prepare(1, 0, SQL_DECIMAL);
> $sth->prepare(2, 0, SQL_DECIMAL);
> $sth->execute()
Don't you want
$sth = $dbh->prepare('exec proc_name \@p1 = ?, \@p2 = ?');
$sth->bind_param(1, 0, SQL_DECIMAL);
$sth->bind_param(2, 0, SQL_DECIMAL);
$sth->execute();
rather than using prepare to bind parameters?
>
> As soon as I do the first prepare I get a SIGSEGV and my
> program crashes.
>
> Mind you this is a linux box, running code by a linux biggot,
> trying to talk to a microsoft server. But still, this is
> perplexing.
>
> Parameters are integers, and thus I can't use generic execute
> because that causes it to assume SQL_CHAR.
--
<Douglas Leonard>
<dleonard at dleonard.net>
More information about the spug-list
mailing list