Subject [IBO] Re: TIBODataset and EXECUTE PROCEDURE with output parameters
Author Luis Semedo Duarte
--- In IBObjects@yahoogroups.com, "Martijn Tonies" <m.tonies@...>
> Right, sorry about that -- let me explain in more detail.
>
> I write the text:
>
> execute procedure myproc(1)
>

First of all is your procedure a Selectable Stored Procedure (SSP) or
a Executable Stored Procedure (ESP). Does your procedure return any
rows, or does it just do something on the database and returns only 1
row of data to the output parameters?

> This procedure has 1 output parameter. When I prepare, IBO creates
> a single output parameter.
>
> Next, I use ExecSQL and kinda expect the parameter to hold the
> output value.
>
> However, the parameter value stays Null.
>

If your procedure is a SSP you should use the "Select * from myproc
(1)" on the SQL property of the TIBOQuery and obtain the data trough
the fields property of the dataset. (and your SSP SQL should end with
a SUSPEND statement).

If however what you realy have is a ESP, you should not use TIBOQuery
but instead use TIBOStoredProc. Fill the StoredProcName property with
the name of your procedure and fill the param property collection.
Call the ExecSQL method and you should have the output parameters
correctly filled.

Hope i helped you! :-)
Luis Semedo Duarte