SP2-0552: Bind variable "xyz" not declared. (Doc ID 1009014.6)

Last updated on DECEMBER 07, 2016

Applies to:

PL/SQL - Version 9.2.0.1 and later
SQL*Plus - Version 9.2.0.1 and later
Information in this document applies to any platform.
***Checked for relevance on 28-Nov-2012***



Symptoms

This Note illustrates two scenarios that can result in the "Bind variable ... not declared" error along with an explanation as to why in conjunction to steps on how to resolve this error.


Scenario 1:

SQL> declare
   mgr varchar2(3);
begin
   :mgr := '001';
end;
/

SP2-0552: Bind variable "MGR" not declared.


Scenario 2:
 

SQL> declare
   mgr varchar2(5);
begin
   select '002' into mgr from dual;
end;
/

PL/SQL procedure successfully completed.

Although the above does not produce an error, the following command will when an attempt to display the value of the mgr variable is done.

SQL> print mgr;
SP2-0552: Bind variable "MGR" not declared. 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms