DBD::Sybase question



Actually, 2 questions:

Q1. I'm using Perl-5.8.1 and DBD::Sybase 1.01 to access stored-procs on a
Sybase ASE 12.5 server. I'm using prepare() with placeholders and OUTPUT
params. I call 2 procs to insert rows. First proc takes 4 args, 1 of which
is an output param, bound with bind_param(). Second proc takes 6 args, 1 of
which is an output param also bound with bind_param(). They work fine and
return correct output params. Then I call a third proc that takes 5 input
params, no output params. The call to the third proc fails indicating that
one of the params was not declared as an OUTPUT param, which is not needed.
The call to prepare looks something like "EXEC proc \@p1 = ?, \@p2 = ?, \@p3
= ?, \@p4 = ?, \@p5 = ?". While searching for various sample code on the
Internet, I ran across one example which had a trailing space after the last
'?', so I figured I'd throw it in for a kick. To my utter amazement, that
fixed the problem. What could the space be doing to fix that problem?

Q2. Another proc I call (using prepare(), placeholders, bind_param(), no
output parms) to insert data will raise error (from within the proc itself)
under certain circumstances, plus return a return-value. When my code
encounters this circumstance it bombs out with "This routine cannot be
called while results are pending for a command that has been sent to the
server," despite my running $sth->finish, as well as iterating over all the
result sets and fetch()ing everything until there are no more results. The
stmt handle is cached in a perl variable that is re-used. Any suggestions
on how to clear the "pending results"?

Doug




.



Relevant Pages