Subject | Re: [ib-support] How do I return value from a SP without SUSPEND? (Delphi specific) |
---|---|
Author | Helen Borrie |
Post date | 2001-07-31T13:19:24Z |
At 02:49 PM 31-07-01 +0200, you wrote:
With a TQuery, you'll have to identify both the input and output parameters to Delphi before preparing (as ptInput and ptOutput respectively) and also their data types (valid members of the ft* set). ParamByName('aparamname').AsWhatever on the output parameter will return the value into your local variable. Executing SPs via a TQuery adds a lot of unnecessary overhead, though I suppose it's a drop in the bucket if you're using the BDE.
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>At 22:30 2001-07-31 +1000, you wrote:If you use IB Objects, you can use a DSQL component and read the return value after execution as FieldByName.
>
> >As you mentioned in your subject, this is a Delphi question, not an
> >InterBase one. The delphi-db list
> >(<mailto:delphi-db-request@...?subject=subscribe>) is ideal for
> >this type of question...
> >
> >However,
> >
> >If you are using the standard VCL for your ib connectivity, use a
> >TStoredProc for executable SPs. Use ParamByName both for sending
> >parameters and for reading return values.
>
>Thanks for the reply. Sorry about the OT post. Will post in delphi group.
>There is a reason that I do not want to use a SP component, but another
>discussion altogether.....
With a TQuery, you'll have to identify both the input and output parameters to Delphi before preparing (as ptInput and ptOutput respectively) and also their data types (valid members of the ft* set). ParamByName('aparamname').AsWhatever on the output parameter will return the value into your local variable. Executing SPs via a TQuery adds a lot of unnecessary overhead, though I suppose it's a drop in the bucket if you're using the BDE.
Cheers,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________