Subject Re: [IBO] Error executing sp
Author constantijnw
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
> At 09:20 PM 5/06/2004 +1000, you wrote:
>
> >Do you mean it retrned no error or no return value? The cursor
should return
> >the value but you now need to use the SELECT syntax
> >SELECT ACCOUNTID FROM
USER_SESSION_START2(:ACCOUNTNAME,:USERNAME:PASSWRD);
>
> Alan,
> Your comments are quite misleading. It is *not* necessary to make a SP
> selectable in order to get the return values.
>

And he can't say noboby warned him that somebody wouldn't like his
views at all!

> The SP as originally written, if called via TIB_DSQL with
>
> EXECUTE PROCEDURE USER_SESSION_START2 (:ACCOUNTNAME,:USERNAME,:PASSWRD)
>
> should return the return value (ACCOUNTID) in the Fields array.
>
> I wonder if it is being called correctly.
>
> You must test whether it is prepared, and call the Execute method,
not Open.
> var
> AcctID: integer;
> begin
>
> with MySP do
> begin
> if not IB_Transaction.Started then
> IB_Transaction.StartTransaction;
> if not Prepared then Prepare;
> ParamByName....
> ParamByName....
> ParamByName....
> Execute;
> AcctID := Fields[0].AsInteger;
> end;
> end;
>
> Helen

Did you see my SP_3 test proc? I have reproduced the error with
IB_STORECPROC and IBOQUERY.
I also tested with IBX's IBSTOREDPROC and its MONITOR didn't show any
error.