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>
|