[SOLVED] PLS-00201 – identifier must be declared. Hints to solve the problem

Here is the solution for most common causes of Oracle PL/SQL PLS-00201 – identifier must be declared exception.

1. Problem

You got a PLS-00201 – identifier must be declared exception during PL/SQL program execution.

2. Cause

The exception occurred usually in cases:

  • when you try to access undeclared variable
  • when you try to execute invalid package/procedure/function
  • when you try to execute package/procedure/function which does not exists
  • when you try to use exception, procedure, package, function which the user does not have permission to.

3. Solution

3.1. You try to access undeclared variable

Check the name of the variable and ensure that it’s correct.

DECLARE
  v_dummy NUMBER;
BEGIN
  v_bunny := 10; --should be v_dummy
END;

3.2. You try to execute invalid package/procedure/function

Check that used objects like PL/SQL procedures/functions/packages are correct and compile them if not.

3.3. You try to execute package/procedure/function which does not exists

Check your spieling of used package/procedure/function and compare it with the package/procedure/function declaration.

BEGIN
  dbms_outputt.put_line('The message'); -- should be dbms_output
END;

3.4. You try to use exception, procedure, package, function which the user does not have permission to.

If the object exists and the name of the object is the same as the referenced object ensure that the user has permission to execute it. Here is an example of missing permission to DBMS_AQ package.

If you think this post is valuable, please leave me +1 or just share it.
Your action helps me to reach a wider audience.
Thank You in advance.

Leave a Reply

avatar
  Subscribe  
Notify of
Close Menu