Subject Re: [ib-support] How do I return value from a SP without SUSPEND? (Delphi specific)
Author Helen Borrie
At 10:34 AM 31-07-01 +0200, you wrote:
>I hope someone can shed some light on this. I am sure I am missing
>something small....
>
>I have a SP like the following
>
>CREATE PROCEDURE PROC(IN_VALUE INTEGER)
> RETURNS(OUT_VALUE INTEGER)
>AS
>BEGIN
> OUT_VALUE = IN_VALUE;
>END
>
>
>Not a very fancy SP you might say, but it's just for the sake of the
>example. 8-)
>
>I want to EXECUTE the SP from Delphi with a TQuery to ge the return value.

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.

e.g. for the inputs:
ParamByName('IN_VALUE').AsInteger := SomeIntegerVariable;

and then, after execution:

MyReturnVariable := ParamByName('OUT_VALUE').AsInteger;

Regards,
Helen

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

[Non-text portions of this message have been removed]