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
Manipulating Individual Elements Faraway you have manipulated an entire collection. Within the SQL, to manipulate the individual elements of the collection, and then use the ope

Records Records are the items of the type RECORD. The Records have exclusively named fields that can store the data values of various types. And hence, a record treat associate

Extension and AND in SQL The theory book gives the following simple example of relational extension in Tutorial D: EXTEND IS_CALLED ADD ( FirstLetter ( Name ) AS Initial )

Truth Tables: However in propositional logic - here we are restricted to expressing sentences and where the propositions are true or false - so we can check where a particular

Number Types The Number types permit you to store the numeric data (real numbers, integers, and floating-point numbers), show quantities, and do computations. BINARY_INTEG

Assignments in pl/sql The Variables and constants are initialized every time a block or subprogram is entered. By default, the variables are initialized to NULL. Therefore, unle

Example of WRAP Operator - SQL The effect of Example can be obtained in SQL but note that one needs to write down not only the names of the columns being wrapped but also the

Example of Alternative formulation as a table constraint Example: Alternative formulation as a table constraint ALTER TABLE EXAM_MARK ADD CONSTRAINT Must_be_enrolled_to_

EXECUTE Privilege To call an invoker-rights routine straightforwardly, the users should have the EXECUTE privilege on that routine. By yielding the privilege, you permit a user

Deleting Objects You can use the DELETE statement to eradicate objects from an object table. To eradicate objects selectively, you use the WHERE clause, as shown below: BEG