Skip to Content.
Sympa Menu

freetds - Re: [freetds] There is a problem passing parameters

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] There is a problem passing parameters
  • Date: Mon, 13 Jun 2005 21:51:43 -0400

Philip wrote:
> 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);
> $sth->execute();

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.

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page