PLS-00201: identifier 'procedure' must be declared [message #280818] |
Wed, 14 November 2007 20:59  |
pigggy
Messages: 4 Registered: November 2007
|
Junior Member |
|
|
Hi, all the experts out there, i am new to db admin.
i have two scripts. one of it is as below. i am trying to execute it but failed for some reason i still cannot figure out yet.
anyone has any idea/suggested, please feel free. thanks
bash-3.1$ cat ERARCH.ER_ARCH.sql
CREATE OR REPLACE PACKAGE "ERARCH"."ER_ARCH"
AS
PROCEDURE er_arch_and_purge (p_days_offset IN INTEGER);
END Er_Arch;
Edit/Delete Message
SQL> exec ERARCH.ER_ARCH.er_arch_and_purge (1) ;
BEGIN ERARCH.ER_ARCH.er_arch_and_purge (1) ; END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'ERARCH.ER_ARCH' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
it seems like it cannot find the sql. is there a specific location i need to put both the sql.script at?
SQL> select owner, object_type from all_objects where object_name='ER_ARCH'
2 ;
no rows selected
SQL> desc ERARCH.ER_ARCH
ERROR:
ORA-04043: object ERARCH.ER_ARCH does not exist
|
|
|
|
|
|
|
|
|
|
|
Re: PLS-00201: identifier 'procedure' must be declared [message #280874 is a reply to message #280830] |
Thu, 15 November 2007 01:25  |
 |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Well, you should definitely read documentation as, obviously, you have no idea what are you doing.
Solution isn't that far, however - remove user name from package name and you'll get rid of that error. After that, create package body because - if you don't do that, there'll be nothing to execute.
See this example and, seriously, READ the documentation.SQL> CREATE OR REPLACE PACKAGE ER_ARCH
2 AS
3 PROCEDURE er_arch_and_purge (p_days_offset IN INTEGER);
4 END Er_Arch;
5 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY er_arch
2 AS
3 PROCEDURE er_arch_and_purge (p_days_offset IN INTEGER)
4 IS
5 BEGIN
6 NULL;
7 END;
8 END;
9 /
Package body created.
SQL> EXEC er_arch.er_arch_and_purge(1);
PL/SQL procedure successfully completed.
SQL>
|
|
|