Error - Identifier must be declared
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Error - Identifier must be declared

Threaded View

  1. #1
    Join Date
    May 2003
    Posts
    49

    Identifier must be declared ***Resolved****

    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?

    Error -
    Code:
    PROCEDURE FCONTDBA.SET_SEQUENCES
    On line:  7
    PLS-00201: identifier 'TABLE_NAME' must be declared
    Procedure -
    Code:
    CREATE Or REPLACE PROCEDURE Set_Sequences (pk_name In VARCHAR2, table_name In VARCHAR2) IS
    
    max_pk NUMBER;
    
    BEGIN
    
    	SELECT max(pk_name) INTO max_pk From table_name;
    	
    	If max_pk = 0 Then
    	   max_pk :=1;
    	End if;
    
    	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');
    
    	COMMIT;
    
    END;
    Regards Allan
    Last edited by Running Bear; 10-16-2003 at 03:05 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width