Subject Re: How do I return value from a SP without SUSPEND? (Delphi specific)
Author rsaeger.edv@t-online.de
> I have a SP like the following
>
> CREATE PROCEDURE PROC(IN_VALUE INTEGER)
> RETURNS(OUT_VALUE INTEGER)
> AS
> BEGIN
> OUT_VALUE = IN_VALUE;
> END
>
> I want to execute the following query in Delphi: EXECUTE PROCEDURE
> PROC(2) and somehow get the return value. I get a 'Parameter not
set'
> error in Delphi when I execute the SQL.
> ...
> Here is the code:
>
> qrySQL.SQL.Clear;
> qrySQL.SQL.Add('EXECUTE PROCEDURE PROC(2)');
> qrySQL.ExecSQL;
>
See 'Parameter not set'. I think, this means _input_ parameter.
Try this:
with qrySQL do begin
StoredProcName := 'Proc';
Prepare;
Params[0].AsInteger := 1;
ExecSQL;
end;

Regards
Richard Saeger