Oracle PL/SQL - References to Identifiers

Introduction

When referencing an identifier, you use a name that is either simple, qualified, remote, or both qualified and remote.

The simple name of an identifier is the name in its declaration. For example:

DECLARE 
  my_variable INTEGER;  -- Declaration 
BEGIN 
  my_variable := 100;     -- Reference with simple name 
END; 
/ 

Qualified name

If an identifier is declared in a named PL/SQL unit, you can reference it with its qualified name.

The syntax is:

unit_name.simple_identifier_name 

For example, if package p declares identifier a, you can reference the identifier with the qualified name p.a.

The unit name can be qualified. You must qualify an identifier when it is not visible (shadowed).

If the identifier names an object on a remote database, you must reference it with its remote name. The syntax is:

simple_identifier_name@link_to_remote_database 

If the identifier is declared in a PL/SQL unit on a remote database, you must reference it with its qualified remote name. The syntax is:

unit_name.simple_identifier_name@link_to_remote_database 

You can create synonyms for remote schema objects, but you cannot create synonyms for objects declared in PL/SQL subprograms or packages.

You can reference identifiers declared in the packages STANDARD and DBMS_STANDARD without qualifying them with the package names, unless you have declared a local identifier with the same name.

Related Topic