Obtaining the Result Status v11
There are several attributes that can be used to determine the effect of a command. SQL%FOUND
is a Boolean that returns TRUE
if at least one row was affected by an INSERT, UPDATE
or DELETE
command or a SELECT INTO
command retrieved one or more rows.
The following anonymous block inserts a row and then displays the fact that the row has been inserted.
SQL%ROWCOUNT
provides the number of rows affected by an INSERT, UPDATE, DELETE
, or SELECT INTO
command. The SQL%ROWCOUNT
value is returned as a BIGINT
data type. The following example updates the row that was just inserted and displays SQL%ROWCOUNT
.
SQL%NOTFOUND
is the opposite of SQL%FOUND
. SQL%NOTFOUND
returns TRUE
if no rows were affected by an INSERT, UPDATE
or DELETE
command or a SELECT INTO
command retrieved no rows.