[freetds] There is a problem passing parameters
James K. Lowden
jklowden at freetds.org
Mon Jun 13 21:51:43 EDT 2005
> The parameter-passing is not working in my DBD-Sybase perl package using
> freetds. I use the latest Freetds. I don't think Freetds has anything to
> do with it, because I can successfully execute this stored procedure
> below from tsql and get the correct results. It has to do with
> DBD-Sybase. I am sing Red Hat Enterprise Linux 3.0, updated. I tried
> with the latest DBD-Sybase and also with DBD-Sybase-1.02.6. In this case
> I expect three types of data: selec from rows, selects like
> 'Total'=@variable and parameters passed. The later don't work. If Myke
> Peppler reads this and wishes to take a look, please contact me.
> exec sp_GetBooksByPrice \@minPrice =2.00 , \@maxPrice = 20.00,
> \@lowestPricedBook = \@minPriceBook OUTPUT, \@highestPricedBook =
> \@maxPriceBook OUTPUT";
> my $sth = $dbh->prepare($query);
You have a Microsoft server, right, 7 SP2 or 2000? Sorry, you lose, it
doesn't work. :-(
Recent Microsoft servers don't return output parameter data unless the
query arrived via an RPC packet. Sending a language command ("exec A @a
output") gets the procedure executed, but you'll never get back @a's data.
Thanks for mentioning it, though. I'll add it to the FAQ.
More information about the FreeTDS