Subject RE: [IBO] Stored proc question
Author Helen Borrie
At 03:05 PM 29-05-01 +0200, you wrote:
>Helen,
>
> One more thing, it's a procedure that is returning a value, is ExecProc
>the preferred way to get the value ? Should I get that value through a
>IB_Cursor ? It's just a one-record select I'm doing.

Well, you >can< do it (and, I think, solve the bug, too, i.e. avoid having to unprepare) by adding a SUSPEND to your stored procedure and using a SELECT from the SP to both execute it and get the return value.

However, you should also be able to bring the return parameter into a variable if you keep it in a stored procedure component. The trick, if I recall correctly, is that, because it is an output column, you need to read it from the Fields (not Params) array after execution, using FieldByName('MyOutputCol').AsWhatever.

Helen



>Thanks,
>
>Nico
> -----Oorspronkelijk bericht-----
> Van: Helen Borrie [mailto:helebor@...]
> Verzonden: dinsdag 29 mei 2001 14:51
> Aan: IBObjects@yahoogroups.com
> Onderwerp: Re: [IBO] Stored proc question
>
>
> At 02:48 PM 29-05-01 +0200, you wrote:
> >Hi all,
> >
> > I have a stored procedure that is executed a few times. When
>it's
> >executed the second time I'm having a Invalid DSQLA structure or
>something
> >like that (forgotten to write it down immediatly).
> >My program looks like this :
> >
> > if not Prepared then
> > Prepare;
> > Params [0].AsString := Trim (IB_Edit1.Text);
> > ExecProc;
> >
> >Do I have to do a close and a Unprepare every time it's executed again ?
>
> Yes, unfortunately, with executable stored procedures you do, because of a
>bug in the API function, that fails to clear a field in that structure after
>execution.
>
> Regards,
> Helen
>
> All for Open and Open for All
> InterBase Developer Initiative · http://www.interbase2000.org
> _______________________________________________________
>
> Yahoo! Groups Sponsor
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
>
>[Non-text portions of this message have been removed]
>
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

All for Open and Open for All
InterBase Developer Initiative · http://www.interbase2000.org
_______________________________________________________