Oracle uses work areas to execute SQL statements and store processing information. A PL/SQL construct called a cursor lets you name a work area and access its stored information. There are two kinds of cursors: implicit and explicit. PL/SQL implicitly declares a cursor for all SQL data manipulation statements, including queries that return only one row. For queries that return more than one row, you can explicitly declare a cursor to process the rows individually.
单行的也可以用显示游标。This is a cursor attribute that can be appended to the name of a cursor or cursor variable. When a cursor is opened, %ROWCOUNT is zeroed. Before the first fetch, cursor_name%ROWCOUNT yields 0. Thereafter, it yields the number of rows fetched so far. The number is incremented if the latest fetch returned a row.
A PL/SQL construct called a cursor lets you name a work area and access its stored
information. There are two kinds of cursors: implicit and explicit. PL/SQL implicitly
declares a cursor for all SQL data manipulation statements, including queries that
return only one row. For queries that return more than one row, you can explicitly
declare a cursor to process the rows individually.
不是SQL%ROWCOUNT这个属性可以知道刚执行的Select语句查询了多少条记录吗?
variable. When a cursor is opened, %ROWCOUNT is zeroed. Before the first fetch,
cursor_name%ROWCOUNT yields 0. Thereafter, it yields the number of rows fetched
so far. The number is incremented if the latest fetch returned a row.