How pl/sql resolves the calls? , PL-SQL Programming

How Calls Are Resolved?

The figure shows that how the PL/SQL compiler resolves the subprogram calls. When the compiler encounters the procedure or function call, it tries to discover a declaration that matches the call. The compiler first searches in the present scope and then, if necessary, in the successive enclosing scopes. The compiler stop searching if it finds one or further subprogram declarations in which the subprogram name match the name of the called subprogram.

To resolve the call along with the possibly like-named subprograms at similar level of the scope, the compiler should find an exact match between the actual and formal parameters. That is, they should match in the number, order, and datatype. If no match is found or if the multiple matches are found, the compilers generate the syntax error.

In the illustration below, you call the enclosing procedure swap from inside the function valid. Though, the compiler generates an error as neither declaration of swap inside the present scope matches the procedure call:

PROCEDURE swap (d1 DATE, d2 DATE) IS

date1 DATE;

date2 DATE;

FUNCTION valid (d DATE) RETURN BOOLEAN IS

PROCEDURE swap (n1 INTEGER, n2 INTEGER) IS BEGIN ... END;

PROCEDURE swap (n1 REAL, n2 REAL) IS BEGIN ... END;

BEGIN

...

swap(date1, date2);

END valid;

BEGIN

...

END;

703_plsql resolves calls.png

Figure: How the PL/SQL Compiler Resolves Calls

Posted Date: 10/5/2012 5:40:17 AM | Location : United States







Related Discussions:- How pl/sql resolves the calls? , Assignment Help, Ask Question on How pl/sql resolves the calls? , Get Answer, Expert's Help, How pl/sql resolves the calls? Discussions

Write discussion on How pl/sql resolves the calls?
Your posts are moderated
Related Questions
Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign

Transaction context As the figure shows, the major transaction shares its context with the nested transactions, but not with the autonomous transactions. Similarly, If one aut

Natural Join - SQL In the absence of NATURAL JOIN Example has to be replaced by something rather more longwinded, as shown in Example. Example: Joining IS_CALLED and IS_EN

Literature review

Write a stored procedure that accepts the post code in which the customer resides as the input parameter. The procedure should then use an explicit cursor to display comprehensive

Majority of Differences among 9i, 10G, 11G :- These are some combine feature which has differences among others. Automatic Workload Repository (AWR) Drop database' s

heap sort program in pl/sql

Project Description: I want to write some SQL statements. The things I need are between pages 5-7. The only problem is that i want it till tomorrow. Skills required is SQL

Character Types The Character types allow you to store alphanumeric data, represent words and text, and manipulate the character strings. CHAR You use the CHAR dataty

Opening a Cursor Opening the cursor executes the query & identifies the result set that consists of all rows that meet the query search criteria. For the cursors declared usin