SQL>
SQL> create table job_parameters
2 ( jobid number primary key,
3 iterations number,
4 table_idx number );
Table created.
SQL>
SQL>
SQL> create or replace procedure bind( p_job in number )
2 as
3 l_rec job_parameters%rowtype;
4 begin
5 select * into l_rec from job_parameters where jobid = p_job;
6 for i in 1 .. l_rec.iterations
7 loop
8 execute immediate
9 'insert into t' || l_rec.table_idx || ' values ( :x )' using i;
10 commit;
11 end loop;
12 delete from job_parameters where jobid = p_job;
13 end;
14 /
Procedure created.
SQL> drop table job_parameters;
Table dropped.
SQL>
SQL>
|