ROW_COUNT
Number of affected rows of the last executed statement
PSQL
INTEGER
ROW_COUNT
The ROW_COUNT context variable contains the number of rows affected by the most recent DML statement (INSERT, UPDATE, DELETE, SELECT or FETCH) in the current PSQL module.
SELECT and FETCH-
After a singleton
SELECT,ROW_COUNTis 1 if a data row was retrieved and 0 otherwise. -
In a
FOR SELECTloop,ROW_COUNTis incremented with every iteration (starting at 0 before the first). -
After a
FETCHfrom a cursor,ROW_COUNTis 1 if a data row was retrieved and 0 otherwise.Fetching more records from the same cursor does not incrementROW_COUNTbeyond 1.
|
Note
|
|
update Figures set Number = 0 where id = :id;
if (row_count = 0) then
insert into Figures (id, Number) values (:id, 0);