Fetch cursor data to number variable : Cursor Fetch « Cursor « Oracle PL / SQL






Fetch cursor data to number variable

 
SQL> create table myTable ( x primary key ) organization index as select 1 from dual;

Table created.

SQL>
SQL> create or replace procedure explicit2 is
  2   cursor explicit_cur is select 1 from myTable;
  3   dummy number;
  4   begin
  5   open explicit_cur;
  6   for i in 1 .. 50000 loop
  7       fetch explicit_cur     into dummy;
  8   end loop;
  9   close explicit_cur;
 10   end;
 11  /

Procedure created.

SQL>
SQL> drop table myTable;

Table dropped.

   
  








Related examples in the same category

1.Below is a function that demonstrates how to use the FETCH statement
2.Fetch value from cursor
3.Fetches the records from a cursor variable that returns employee information
4.Fetch cursor to two variables
5.legal and illegal FETCH statements.
6."ORA-1002: fetch out of sequence" because of the commit inside the SELECT..FOR UPDATE loop.
7.A WHILE cursor fetch loop.
8.Different BULK_COLLECT statements used for bulk binds
9.Check Cursor%FOUND after fetching
10.Fetch value in cursor until NOTFOUND
11.ORA-01002: fetch out of sequence
12.Fetch out cursor value and insert to another table
13.PLS-00394: wrong number of values in the INTO list of a FETCH statement
14.FETCH cursor BULK COLLECT
15.Fetch cursor till cursorVariable%notfound
16.Fetch cursor to table collection of row type
17.Fetch cursor value to three variables
18.Fetch row by row
19.Fetch single column cursor to varchar2 variable