John Ulmer writes:
 > As always, if this is the wrong mailing list or if this information
 > exists in a faq I have not found yet, please accept my apologies and
 > point me in the correct direction.

 > I have a stored procedure on the SQL Server7
 > that looks like,
 > 
 > CREATE PROCEDURE AddMe_Out
 >         @p1 int = 0,
 >         @p2 int OUTPUT
 > AS
 >         SELECT @p2 = 10 * @p1
 > GO

You're close.

The following should work:

$sth = $dbh->prepare("
declare \@param int
select \@param = 3
exec AddMe_Out \@p1 = 5, \@p2 = \@param output
");

and then process all the results.

It's a little cumbersome, but that's not the fault of DBD::Sybase.

0.93 and later (yes I know - doesn't build with FreeTDS [yet!]) can do
this differently:

$sth = $dbh->prepare("exec AddMe_Out \@p1 = ?, \@p2 = ? OUTPUT");
$sth->execute(5, 3);
etc.

I believe that 0.93 *will* build with the latest FreeTDS snapshot, so
you can give this a try if you want.

Michael
-- 
Michael Peppler - Data Migrations Inc. - http://www.mbay.net/~mpeppler
[EMAIL PROTECTED] - [EMAIL PROTECTED]
International Sybase User Group - http://www.isug.com

Reply via email to