Cursor has four attributes like
%rowcount
%found
%notfound
%open
Why do we prefix SQL to the attribute of implicit cursor? eg:
DBMS_OUTPUT.PUT_LINE(SQL%ROWCOUNT || 'row(s) delete开发者_如何学编程d');
- Because it's required: if you don't, you'll get a syntax error.
- Because that's what the name of the implicit cursor is.
- SQL stands for Structured Query Language, which is the language used to specify a query (or DML) run by a cursor.
- Because it's only 3 letters to type, as opposed to
THE_IMPLICIT_CURSOR_FOR_THE_LAST_SQL_STATEMENT_EXECUTED%ROWCOUNT
- Because Oracle says so, and that's final :)
精彩评论