Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask PL-SQL Expert

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);

PL-SQL, Programming

  • Category:- PL-SQL
  • Reference No.:- M9510709

Have any Question?


Related Questions in PL-SQL

Assignment - queries functions and triggersaimthe aims of

Assignment - Queries, Functions and Triggers Aim The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL queries; create SQ ...

For this assignment you will be provided a database backup

For this assignment, you will be provided a database backup for a database called FinanceDB. You will have to restore this backup to your own version of SQL Server. All of the questions in this assignment relate to the F ...

Purpose of the assessment with ulo mapping the purpose of

Purpose of the assessment (with ULO Mapping) The purpose of this assignment is to develop skills in managing data in databases and to gain understanding of data model development and implementation using a commercially a ...

Complete the following tasksin microsoft access create the

Complete the following tasks: In Microsoft Access, create the database and tables that you identified in W3 Assignment 2. In Microsoft Word, write the SQL statements to create the database and tables. Write SQL statement ...

Continuing the project you have worked on in weeks 1-4 in

Continuing the project you have worked on in Weeks 1-4, in this final week, complete the following tasks: Refine your database and SQL statements by incorporating your instructor's feedback. Verify that the database comp ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As