This content has been marked as final. Show 2 replies
True, documentation states last_row_count it should not be used after execute. So probably not safe to rely on this behaviour.
But the docs for execute statement says:
This function executes a given cursor. This function accepts the ID number of the cursor and returns the number of rows processed. The return value is only valid for INSERT, UPDATE, and DELETE statements; for other types of statements, including DDL, the return value is undefined and should be ignored.
Returns number of rows processed
And this is from the package spec:
So it should be documented that you simply can use the nReturn value ;-)
function execute(c in integer) return integer; -- Execute the given cursor and return the number of rows processed -- (valid and meaningful only for INSERT, DELETE or UPDATE statements; -- for other types of statements, the return value is undefined and -- should be ignored). -- Input parameters: -- c -- Cursor id number of the cursor to execute. -- Return value: -- Number of rows processed if the statement in the cursor is -- either an INSERT, DELETE or UPDATE statement or undefined otherwise. --