I've written a procedure to update the sequences in my DB. I'm getting an error when I compile it. Says the identifier 'table_name' must be declared, which it is as an input param. Does anyone know what the probem might be, and how to fix it?
On line: 7
PLS-00201: identifier 'TABLE_NAME' must be declared
CREATE Or REPLACE PROCEDURE Set_Sequences (pk_name In VARCHAR2, table_name In VARCHAR2) IS
SELECT max(pk_name) INTO max_pk From table_name;
If max_pk = 0 Then
EXECUTE IMMEDIATE ('drop sequence ' || pk_name);
EXECUTE IMMEDIATE ('create sequence ' || pk_name || ' start with ' || max_pk || ' increment by 1 min value 1 nocycle cache 20 noorder');