in reply to Re: Re: SQL Stored Procedure return value
in thread SQL Stored Procedure return value

There are a few possibilities. First, it may seem obvious, but are you sure the stored procedure is doing what you think? Can you invoke in interactive SQL and get what you expect? Second, are you using FreeTDS to connect to SQL Server? There are some known problems with it, and you may be stepping on one of them. Try using DBD::ADO or DBD::ODBC (which have their own set or problems, I know), and see if the situation improves. Otherwise, I don't see any obvious problems.

  • Comment on Re (3): SQL Stored Procedure return value

Replies are listed 'Best First'.
Re: Re (3): SQL Stored Procedure return value
by gnangia (Scribe) on Jul 17, 2003 at 18:51 UTC
    I am using freetds, DBI and DBD::Sybase as my means of connecting to sql server. I can connect to the SQL server because I can do a select \@\@version sql command and get the output ok. So I know the perl connection to SQL server is ok. Here is a test procedure I used and it still does not work. Stored Procedure is ->
    CREATE PROCEDURE TEST @results numeric(9,4) OUTPUT AS BEGIN SELECT @results = 9999.9999 END
    Here is the sql statement I use to retrieve the result at a sql command line.
    declare @mytest numeric(9,4) exec TEST @results=@mytest OUTPUT print @mytest
    Now how would I translate that to my perl code to retrieve the output which should just be 9999.9999. Please note that the last print @mytest is only being used to print to stdout. Please advise.