I'd like to have the tablename as a parameter for a procedure:
CREATE OR REPLACE
PROCEDURE myproc( p_table VARCHAR2 )
AS
CURSOR c_forcolumn (p_table VARCHAR2)
IS
SELECT alpha.ROWID ,alpha.scope_column
FROM p_table alpha
ORDER BY scope_column;
BEGIN
NULL;
FOR rec IN myproc(the_scope_table)
LOOP
IF (rec.scope_column LIKE 'ABC___' ) THEN
---do something
UPDATE p_table
SET scope_column = 'XYZ'
WHERE rec.ROWID = p_table.ROWID;
NULL;
END IF;
END LOOP;
END myproc;
Is there a way to implement this ?
CREATE OR REPLACE
PROCEDURE myproc( p_table VARCHAR2 )
AS
CURSOR c_forcolumn (p_table VARCHAR2)
IS
SELECT alpha.ROWID ,alpha.scope_column
FROM p_table alpha
ORDER BY scope_column;
BEGIN
NULL;
FOR rec IN myproc(the_scope_table)
LOOP
IF (rec.scope_column LIKE 'ABC___' ) THEN
---do something
UPDATE p_table
SET scope_column = 'XYZ'
WHERE rec.ROWID = p_table.ROWID;
NULL;
END IF;
END LOOP;
END myproc;
Is there a way to implement this ?