Firebird Documentation IndexFirebird 1.5 Language Ref. UpdateContext variables → ROW_COUNT
Firebird Home Firebird Home Prev: INSERTINGFirebird Documentation IndexUp: Context variablesNext: SQLCODE

ROW_COUNT

Tip

Find a more recent version at Firebird 5.0 Language Reference: ROW_COUNT

Available in: PSQL

Added in: 1.5

Description: The ROW_COUNT context variable contains the number of rows affected by the most recent DML statement (INSERT, UPDATE or DELETE) in the current trigger or stored procedure.

Type: INTEGER

Example: 

update Figures set Number = 0 where id = :id;
if (row_count = 0) then
  insert into Figures (id, Number) values (:id, 0);

Notes

  • For SELECT statements, ROW_COUNT currently returns 0.

  • ROW_COUNT cannot be used to determine the number of rows affected by an EXECUTE STATEMENT or EXECUTE PROCEDURE command.

Prev: INSERTINGFirebird Documentation IndexUp: Context variablesNext: SQLCODE
Firebird Documentation IndexFirebird 1.5 Language Ref. UpdateContext variables → ROW_COUNT