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

Assignment Help:

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


Related Discussions:- How pl/sql resolves the calls?

Explicit cursors, Explicit Cursors The set of rows returned by the que...

Explicit Cursors The set of rows returned by the query can include zero, one, or multiple rows, depending on how many rows meet your search criteria. Whenever a query returns

PROCEDURES AND FUNCTIONS QURIES, i NEED THE QURIES TO SOME OF THE PROBLEMS ...

i NEED THE QURIES TO SOME OF THE PROBLEMS USING plsql

Declare keyword description in pl sql, DECLARE : This keyword signals t...

DECLARE : This keyword signals the beginning of the declarative section of the PL/SQL block, that contains local declarations. The Items declared locally exist only within the

How bulk bind helps improvement in performance?, How Bulk Binds Improve Per...

How Bulk Binds Improve Performance The assigning of values to the PL/SQL variables in SQL statements is known as binding. The binding of the whole collection at once is know

Avoiding collection exceptions, Avoiding Collection Exceptions   In ma...

Avoiding Collection Exceptions   In many cases, if you reference a nonexistent collection element, then PL/SQL raises a predefined exception. Consider the illustration shown b

%type - cursors, %TYPE: This attribute gives the datatype of a formerly...

%TYPE: This attribute gives the datatype of a formerly declared collection, cursor variable, object, field, record, database column, or variable. Datatype: This is simply

Parameter and keyword description - update statement, Parameter and Keyword...

Parameter and Keyword Description:   table_reference: This keyword identifies the table or view that should be accessible when you execute the UPDATE statement, and for wh

Use tsql function sql server 2012, I want someone to write a TSQL function ...

I want someone to write a TSQL function that returns the name of the ODBC DSN. I will use the queries below, to get information about the connection, but none of these return th

Package utl file in pl/sql, UTL_FILE: The Package UTL_FILE permits you...

UTL_FILE: The Package UTL_FILE permits your PL/SQL programs to read & write operating system (OS) text files. It gives a restricted version of the standard OS stream file I/O,

Package specification, The Package Specification The package specificat...

The Package Specification The package specifications contain the public declarations. The scopes of these declarations are local to your database representation and global to t

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd