Subject | Re: RETURNING_VALUES KeyWord failing |
---|---|
Author | constantijnw |
Post date | 2004-07-08T18:29:22Z |
Hi Filipe,
server.
Your SP takes 4 inputparameters (lets say P1, P2, P3, P4), executes a
DML statement and returns ROW_COUNT via the Rows_Aff outputparameter.
Right?
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:
sp_geraconta_so.Execute;
And finally, you retrieve the outputparameter via the Fields property:
RowsAff := sp_geraconta_so.FieldByName('Rows_Aff').AsInteger;
Constantijn
> I am calling an "EXECUTE PROCEDURE" in a TIB_DSQL.You can't use Firebirds PSQL (procedure/trigger) language outside the
> But occurs an exception: "Token unknown: RETURNING_VALUES".
>
> SQL:
> EXECUTE PROCEDURE sp_geraconta_so "07/2004", 50, 20, 30
> RETURNING_VALUES :Rows_Aff
>
server.
Your SP takes 4 inputparameters (lets say P1, P2, P3, P4), executes a
DML statement and returns ROW_COUNT via the Rows_Aff outputparameter.
Right?
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:
sp_geraconta_so.Execute;
And finally, you retrieve the outputparameter via the Fields property:
RowsAff := sp_geraconta_so.FieldByName('Rows_Aff').AsInteger;
Constantijn