Subject | Re: How do I return value from a SP without SUSPEND? (Delphi specific) |
---|---|
Author | rsaeger.edv@t-online.de |
Post date | 2001-07-31T08:49:26Z |
> I have a SP like the followingset'
>
> 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
> error in Delphi when I execute the SQL.See 'Parameter not set'. I think, this means _input_ parameter.
> ...
> Here is the code:
>
> qrySQL.SQL.Clear;
> qrySQL.SQL.Add('EXECUTE PROCEDURE PROC(2)');
> qrySQL.ExecSQL;
>
Try this:
with qrySQL do begin
StoredProcName := 'Proc';
Prepare;
Params[0].AsInteger := 1;
ExecSQL;
end;
Regards
Richard Saeger