Name resolution - pl/sql, PL-SQL Programming

Name Resolution 

During the compilation, the PL/SQL compiler relates identifiers like the name of a variable with an address or memory location, actual value, or datatype. This process is termed as the binding. The relationship lasts through all the successive executions until the recompilation occurs, which may cause the rebinding.

Before binding the names, the PL/SQL should solve all the references to them in the compilation unit. This process is known as the name resolution. The PL/SQL considers all the names to be in the same namespace. Therefore, one declaration or definition in an inner scope can hide the other in an outer scope. In the illustration below, the declaration of the variable client hides the definition of the datatype Client as the PL/SQL is not case sensitive apart from within the string literals:

BEGIN

<>

DECLARE

TYPE Client IS RECORD (...);

TYPE Customer IS RECORD (...);

BEGIN

DECLARE

client Customer; -- hides definition of type Client

-- in outer scope

lead1 Client; -- illegal; Client resolves to the

-- variable client

lead2 block1.Client; -- OK; refers to type Client

BEGIN

NULL;

END;

END;

END;

Though, you can still refer to the datatype Client by qualifying the reference with the block label block1.

In the CREATE TYPE person1 statement below, the compiler solves the second reference to the manager as the name of the attribute you are trying to declare. In the CREATE TYPE person2 declaration, the compiler solves the second reference to the manager as the name of the attribute you merely declared. In both the situation, the reference to the manager generates an error as the compiler expects a type name.

CREATE TYPE manager AS OBJECT (dept NUMBER);

CREATE TYPE person1 AS OBJECT (manager manager);

CREATE TYPE person2 AS OBJECT (manager NUMBER, mgr manager);

Posted Date: 10/8/2012 8:15:00 AM | Location : United States







Related Discussions:- Name resolution - pl/sql, Assignment Help, Ask Question on Name resolution - pl/sql, Get Answer, Expert's Help, Name resolution - pl/sql Discussions

Write discussion on Name resolution - pl/sql
Your posts are moderated
Related Questions
Semidifference and NOT - SQL In this section first describe the relational difference operator, named MINUS. Example here shows SQL's closest counterpart of that operator.

Using FIRST and LAST FIRST and LAST return the first and last (minimum and maximum) index numbers in a collection. When the collection is empty, the FIRST and LAST return NULL

i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

TYPES OF EVOLUTION - Sequential evolution                  :                    Minor changes in the gene pool of a population from one generation to the next, with the resul

Bulk Fetching The illustration below shows that you can bulk-fetch from a cursor into one or more collections: DECLARE TYPE NameTab IS TABLE OF emp.ename%TYPE; TYPE S

Oracle 10G new features:- Automatic Database Diagnostic Monitor System Advancements - these methods will provides several methods for extracting reports through the Automatic

Need Database Development with Analysis Tools Project Description: I want a database for large governmental and private data sets on one country that can be simply extended t

Example of UNWRAP Operator - SQL Example here shows how unwrapping can be done in longhand in SQL. Example: Unwrapping in SQL Letting CONTACT_INFO_WRAPPED denote the res

Overriding Default Locking By default, the Oracle locks the data structures for you automatically. Though, you can request exact data locks on rows or tables when it is to you

Parameter and Keyword Description: SQL: This SQL is the name of the implicit SQL cursor. %FOUND: This attribute results TRUE if an INSERT, DELETE, or UPDATE state