Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> sqlplus: starting multiple procedures by a dynamic file name
The purpose of this is to simply delete test data from the tables
(alleviates primary key confliction) and execute other .sql files
(individual templates) to load new test data.
I would appreciate help with executing code along these lines... (the variables in v_filename are in the local directory.)
This program is called using sqlplus:
SQL> @the_script
##################Inside the_script#################################Declare
for v_counter in 1..20 loop
delete from table1 where primarykey = v_counter; delete from table2 where primarykey = v_counter; delete from table3 where primarykey = v_counter; v_filename := '@' || v_counter || '.sql';
--Now here is the tricky part....
--How do i execute a "start" or "@" on a variable ?
--This next line does not work:
execute @v_filename;
end loop;
end;
/
PS. Feel free to flame about not reading manuals and being a noob :P
Tanks for your help. Received on Wed Sep 26 2001 - 22:15:20 CDT