Using operator value in pl sql, PL-SQL Programming

Assignment Help:

Using Operator VALUE:

As you may expect, the operator VALUE returns the value of an object. The VALUE takes its argument a correlation variable.  For illustration, to return a result set of the Person objects, you can use the VALUE as shown below:

BEGIN

INSERT INTO employees

SELECT VALUE(p) FROM persons p

WHERE p.last_name LIKE '%Smith';

In the next example, you use VALUE to return a specific Person object:

DECLARE

p1 Person;

p2 Person;

...

BEGIN

SELECT VALUE(p) INTO p1 FROM persons p

WHERE p.last_name = 'Kroll';

p2 := p1;

...

END;

At this position, p1 holds a local Person object, that is a copy of the stored object whose last name is 'Kroll', and p2 holds the other local Person object, that is a copy of p1. As the illustration below shows, you can use these variables to access and update the objects they have:

BEGIN

p1.last_name := p1.last_name || 'Jr';

Currently, the local Person object held by p1 has the last name 'Kroll Jr'.


Related Discussions:- Using operator value in pl sql

Create GUIs in PL/SQL, i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

i NEED TO CREATE 3 guiS IN pl/sql sERVER PAGE FORM

Laws / rules associated with evolution, LAWS / RULES - Dollo's Law    ...

LAWS / RULES - Dollo's Law                     :           Living organisms do exhibit evolutionary irreversibility or evolution is irreversible. Williston's Law

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 a stored procedure, a. Create a table odetails_new. It has all the a...

a. Create a table odetails_new. It has all the attributes of odetails and an additional column called cost, whose values are the product of the quantity and price of the part bein

Sql, If two relations R and S are joined, then the non matching tuples of b...

If two relations R and S are joined, then the non matching tuples of both R and S are ignored in __________________.

Identifiers in pl/sql, Identifiers You use identifiers to name the PL/S...

Identifiers You use identifiers to name the PL/SQL program items and units that include constants, variables, cursors, exceptions, cursor variables, subprograms, and packages.

%found - explicit cursor attributes, %FOUND Subsequent to a cursor or ...

%FOUND Subsequent to a cursor or cursor variable is opened but before the first fetch, the %FOUND yields NULL. Afterward, it yields TRUE when the last fetch returned a row, or

Write an anonymous block that contains a pl/sql function, a. Write an anon...

a. Write an anonymous block that contains a PL/SQL function. Given an order number orderNo, the function will calculate the total number of the parts in the order. Then the anonym

Open-for statement, OPEN-FOR Statement The OPEN-FOR statements execute ...

OPEN-FOR Statement The OPEN-FOR statements execute the multi-row query related with a cursor variable. It also allocates the resources used by the Oracle to process the query a

Application to export excel data to mssql server table, Application to Expo...

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

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