[unixODBC-dev] Getting "Return Values" from Stored Procedures

Don Oliver doliver at nxtv.com
Fri Aug 20 00:41:20 BST 2004


Thanks Nick,

I have tried putting that syntax into the commands, but it fails.

I have only been able to successfully call stored procedures using this
syntax :

"exec procedure_name param1, param2, param3"

which is the same syntax that works in the "isql" program that came with
unixodbc.

Don


On Thu, 19 Aug 2004, Nick Gorham wrote:

> Don Oliver wrote:
>
> > Hi all,
> >
> > I am a newbie.
> >
> > Using unixODBC 2.2.2 with freetds-0.61 to access a MS-SQL database.
> >
> > I have successfully used many of the SQL functions to Open connections,
> > get Record Sets, read rows, columns, etc. All very cool.
> >
> > The only problem is that I cannot figure out how to read the "Return Value"
> > provided by Stored Procedures. If the Stored Procedure returns a Record Set, I
> > can read the rows fine, but if it returns a "Return Value"??
> >
> > I am porting some code from ASP/JavaScript/ADO, and I see them using Command
> > objects which use code like :
> >
> > param = commandObj.CreateParameter("RV", adInteger, adParamReturnValue);
> >
> > Is there an equivalent parameter type in the ODBC specification??
>
> Normally you would execute a statement like (This is the ODBC syntax, so
> drivers can map it to whatever works for them)
>
> {call proc( ?, ?, ? )}
>
> where the ? are the parameter place markers, and you bind them as input,
> output or inout.
>
> if the procedure returns a value, then the syntax is
>
> {?=call func( ?, ?, ? )}
>
> Where the first param is the output param.
>
> However as to if this works in freetds, I don't know.
>
> --
> Nick Gorham
> Easysoft Limited
> _______________________________________________
> unixODBC-dev mailing list
> unixODBC-dev at mail.easysoft.com
> http://mail.easysoft.com/mailman/listinfo/unixodbc-dev
>



More information about the unixODBC-dev mailing list