Submit a Table Name as a Parameter to a Procedure for Processing? [message #40321] |
Fri, 27 September 2002 05:53 |
Lloyd M. Terrell
Messages: 5 Registered: September 2002
|
Junior Member |
|
|
How do I submit a table name as a parameter to a procedure? I have to develope PL/SQL code to process a number of tables. The only thing that changes are the table names. I need to do something as follows:
CREATE OR REPLACE PROCEDURE DO_SMTHG(table_name IN VARCHAR2)
BEGIN
...
UPDATE table_name
...
END;
Would I have to do something like:
UPDATE &table_name
in order to use the table name within the code?
The script I will be using to execute this procedure will look something like this (VMS System - This job will be scheduled to run over night):
SQLPLUS SCOTT/TIGER@MADDEV.WORD EXECUTE DO_SMTHG('DEPT');
SQLPLUS SCOTT/TIGER@MADDEV.WORD EXECUTE DO_SMTHG('EMP');
SQLPLUS SCOTT/TIGER@MADDEV.WORD EXECUTE DO_SMTHG('BONUS');
...
Thanks.
|
|
|
|