Subject Re: RETURNING_VALUES KeyWord failing
Author constantijnw
Hi Filipe,

> I am calling an "EXECUTE PROCEDURE" in a TIB_DSQL.
> But occurs an exception: "Token unknown: RETURNING_VALUES".
> SQL:
> EXECUTE PROCEDURE sp_geraconta_so "07/2004", 50, 20, 30

You can't use Firebirds PSQL (procedure/trigger) language outside the

Your SP takes 4 inputparameters (lets say P1, P2, P3, P4), executes a
DML statement and returns ROW_COUNT via the Rows_Aff outputparameter.

Then the SQL statement in TIB_SQL looks like this:
EXECUTE PROCEDURE sp_geraconta_so (:P1, :P2, :P3, :P4);

You provide values for those parameters (after a prepare) via the
Params property:
sp_geraconta_so.ParamByName('P1').AsString := '07/2000';
etc. for all other inputparameters

You execute this SP via:

And finally, you retrieve the outputparameter via the Fields property:
RowsAff := sp_geraconta_so.FieldByName('Rows_Aff').AsInteger;