Skip to content
Home » Oracle » How to Resolve ORA-04050: invalid or missing procedure, function, or package name

How to Resolve ORA-04050: invalid or missing procedure, function, or package name

ORA-04050

Tried to create a stored procedure, i.e. procedure, function or package, but it failed with ORA-04050.

Reserved Word

SQL> create procedure audit;
  2  /
create procedure audit;
                 *
ERROR at line 1:
ORA-04050: invalid or missing procedure, function, or package name

Begin with Digit

SQL> create procedure 999;
  2  /
create procedure 999;
                 *
ERROR at line 1:
ORA-04050: invalid or missing procedure, function, or package name

ORA-04050 means that the identifier you chose cannot be used for the stored procedure's name, which is invalid and unqualified for an object name in Oracle database.

Which means, don't use any reserved words, don't use names begin with a digit either.

Solution

To have a qualified object name, you need to conform to the Oracle Database Object Names and Qualifiers.

SQL> create procedure audit999;
  2  /

Warning: Procedure created with compilation errors.

If you really want to name an object by a keyword or beginning with a digit, you should use double quotations to enclose its name. To better understanding how to properly use a quoted identifier (exact form), we have some examples for you.

For more error patterns about invalid identifier, you may refer to the post: How to Resolve ORA-00903: invalid table name.

Leave a Reply

Your email address will not be published. Required fields are marked *