PLSQL
PLSQL
PLSQL
DECLARE
variable declaration message varchar2(20):= 'Hello,
World!';
BEGIN
/* * PL/SQL executable statement(s) */
dbms_output.put_line(message);
END; /
A cursor is a pointer to this context area.
PL/SQL controls the context area through a
cursor. A cursor holds the rows (one or more)
returned by a SQL statement. The set of rows
the cursor holds is referred to as the active
set.
%FOUND
Returns TRUE if an INSERT, UPDATE, or DELETE statement
1
affected one or more rows or a SELECT INTO statement
returned one or more rows. Otherwise, it returns FALSE.
%NOTFOUND
The logical opposite of %FOUND. It returns TRUE if an
2 INSERT, UPDATE, or DELETE statement affected no rows, or
a SELECT INTO statement returned no rows. Otherwise, it
returns FALSE.
%ISOPEN
3 Always returns FALSE for implicit cursors, because Oracle
closes the SQL cursor automatically after executing its
associated SQL statement.
%ROWCOUNT
Returns the number of rows affected by an INSERT,
4 UPDATE, or DELETE statement, or returned by a SELECT
INTO statement.
Explicit Cursors
Explicit cursors are programmer-defined cursors for
gaining more control over the context area.