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?

Update stock levels, At times, customers make mistakes in submitting their ...

At times, customers make mistakes in submitting their orders and call to cancel the order. Brewbean's wants to create a trigger that automatically updates the stock level of all pr

Example of null operator - nino rule, Example of Null operator - NiNo Rule ...

Example of Null operator - NiNo Rule If we wanted to make HIGHER_OF adhere to "NULL in, NULL out"-let's call it the NiNo rule-we would have to write something like what is sho

Comparison operators - sql operators, Comparison Operators Usually, yo...

Comparison Operators Usually, you use the comparison operators in the WHERE clause of a data manipulation statement to form the predicates, that compare one expression to anot

Table comparison - sql, Table Comparison - SQL The following definitio...

Table Comparison - SQL The following definitions for relation comparisons: Let r1 and r2 be relations having the same heading. Then: r1 ⊆ r2 is true if every tuple of r1

Effects of null in table literal, Effects of NULL in Table Literal Whe...

Effects of NULL in Table Literal When a VALUES expression appears as the source value for an SQL INSERT statement, the key word NULL can appear as a field value, such that for

%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

Assignment 4, I need a query for PL/SQL, selecting names with cursor, goes ...

I need a query for PL/SQL, selecting names with cursor, goes down the list, assigns usernames (initials001) based on initials in the name. If two names have same initials the user

Using lock table, Using LOCK TABLE You use the LOCK TABLE statement to...

Using LOCK TABLE You use the LOCK TABLE statement to lock the whole database tables in the specified lock mode so that you can share or deny the access to them. For illustrati

Transaction visibility, Transaction Visibility As the figure shows, th...

Transaction Visibility As the figure shows, the changes made by an autonomous transaction become visible to another transaction whenever the autonomous transaction commits. Th

Restriction and and - sql, Restriction and AND - SQL Restriction is av...

Restriction and AND - SQL Restriction is available via the WHERE operator, and so it is in SQL. However, by Example showing how a certain simple restriction can be expressed u

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