Timing a ref cursor : ref cursor « Cursor « Oracle PL/SQL Tutorial






SQL>
SQL> declare
  2      type rc is ref cursor;
  3      l_rc rc;
  4      l_dummy all_objects.object_name%type;
  5      l_start number default dbms_utility.get_time;
  6  begin
  7      for i in 1 .. 1000
  8      loop
  9          open l_rc for
 10          'select object_name
 11             from all_objects
 12            where object_id = :x'
 13          using i;
 14          fetch l_rc into l_dummy;
 15          close l_rc;
 16      end loop;
 17      dbms_output.put_line
 18      ( round( (dbms_utility.get_time-l_start)/100, 2 ) ||
 19        ' seconds...' );
 20  end;
 21  /
.63 seconds...

PL/SQL procedure successfully completed.

Elapsed: 00:00:00.70
SQL>
SQL> set timing off








25.12.ref cursor
25.12.1.Create and use reference cursor
25.12.2.Creating a REF CURSOR datatype
25.12.3.Timing a ref cursor
25.12.4.REF CURSOR custom type
25.12.5.Reference cursor
25.12.6.Reference value in a cursor by cursor variable