Open cursor by index : Cursor parameters « Cursor « Oracle PL / SQL






Open cursor by index

  

SQL>
SQL> create table t ( object_id primary key, object_name )
  2  organization index
  3  as
  4  select object_id, object_name from all_objects;

Table created.

SQL>
SQL> create or replace procedure explicit
  2  as
  3      l_object_name t.object_name%type;
  4      l_dummy       t.object_name%type;
  5
  6      cursor c( l_object_id in number)is
  7      select object_name
  8      from t
  9      where object_id = l_object_id;
 10  begin
 11      for i in 1 .. 30000
 12      loop
 13          open c(i);
 14              fetch c into l_object_name;
 15          close c;
 16      end loop;
 17  end;
 18  /

Procedure created.

SQL>
SQL>
SQL>
SQL> drop table t;

Table dropped.

   
    
  








Related examples in the same category

1.Cursor with parameter
2.Cursor without parameters (simplest)
3.cursor parameters are used to specify the classid for which lecturer is listed at runtime
4.Explicit cursor with parameter
5.Number Parameterized Cursors
6.For loop with parameterized cursor
7.Declaration of a parameterized cursor which has two parameters