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
%NOTFOUND The %NOTFOUND is logical, opposite of the %FOUND. The %NOTFOUND yields FALSE if the last fetch returned a row, or TRUE when the final fetch failed to return a row. I

Application to Export Excel Data to MSSQL Server table I am having a table available in excel format and features the subsequent: - Some text is in Arabic (e.g. UTF-8 encodin

1. a. Write a trigger that fires when a part's price is updated. The trigger will write a record into a table called PriceUpdates. The record should contain the information of

Restriction in SQL Syntax: SELECT DISTINCT StudentId FROM IS_CALLED WHERE Name = 'Boris' The WHERE clause operates on the result of the FROM clause in analogo

Indeterminacy in SQL Some SQL expressions are actually not function invocations at all in the mathematical sense, being indeterminate-invocations operating on identical input

INSERT Command in SQL Loosely speaking, INSERT takes the rows of a given source table and adds them to the specified target table, retaining all the existing rows in the targ

SQL Pseudocolumns The PL/SQL recognizes the following SQL pseudocolumns, that returns the specific data items: LEVEL, NEXTVAL, CURRVAL, ROWID, & ROWNUM. The Pseudocolumns are n

Using LIMIT For nested tables, that have no maximum size, the LIMIT returns NULL. For varrays, the LIMIT returns the maximum number of elements that a varray can have (that yo

Closing a Cursor Variable The CLOSE statement disables the cursor variable. After that, the related result set is undefined. The syntax for the same is as shown below: CLOS

Defining Autonomous Transactions To define an autonomous transaction, you use the pragma (compiler directive) AUTONOMOUS_TRANSACTION. The pragma instructs the PL/SQL compiler