Timing passing table collection parameter to a procedure : Timing « SQL Plus « Oracle PL / SQL






Timing passing table collection parameter to a procedure

    

SQL> create or replace type num_list is table of number;
  2  /

Type created.

SQL> create or replace procedure DO_WORK(x num_list) is
  2   begin
  3       for i in 1 .. x.count loop
  4           null;
  5       end loop;
  6   end;
  7  /

Procedure created.

SQL> set timing on
SQL> declare
  2   v varchar2(32767) := 'num_list(';
  3   begin
  4       for i in 1 .. 5000 loop
  5           v := v || case when i = 1 then to_char(i) else ','||i end;
  6       end loop;
  7       v := v || ')';
  8       execute immediate 'begin do_work('||v||'); end;';
  9   end;
 10  /

PL/SQL procedure successfully completed.

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

   
    
    
    
  








Related examples in the same category

1.Time command
2.Time and autotrace a big table
3.Time query for a huge table
4.time a query with where clause
5.Time lower text function
6.Loop timing
7.timing unconditional loop
8.Statistics query Timing on index
9.Performace difference between sql and pl/sql
10.TIMING table copying