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

Parameter and keyword description - open-for statement, Parameter and Keywo...

Parameter and Keyword Description: cursor_variable_name: This identifies a cursor variable or the parameter formerly declared within the present scope. host_cursor_va

Delete command - sql, DELETE Command - SQL Loosely speaking, DELETE re...

DELETE Command - SQL Loosely speaking, DELETE removes some existing rows from its target table. Suppose the university decides that course C3 is to be withdrawn. Example shows

Closing a cursor variable, Closing a Cursor Variable The CLOSE stateme...

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

Cosmozoic theory - origin of life, COSMOZOI C THEORY - Richter (1865...

COSMOZOI C THEORY - Richter (1865) proposed the cosmozoic theory that says that life came by spores (cosmozoa) or other particles from other planets on the earth.

Literals in pl/sql, Literals A literal is an explicit numeric, string...

Literals A literal is an explicit numeric, string, character, or Boolean value not represented by an identifier. Numeric literal 147 and the Boolean literal FALSE are some of

Row operators - sql operators, Row Operators The Row operators return ...

Row Operators The Row operators return or reference the particular rows. ALL retains the duplicate rows in the result of a query or in an aggregate expression. The DISTINCT el

Recursion, Recursion The Recursion is a powerful method for simplify th...

Recursion The Recursion is a powerful method for simplify the design of the algorithms. Principally, the recursion means the self-reference. In the recursive mathematical serie

Theory of spontaneous generation - origin of life, THEORY OF SPONTANEOUS GE...

THEORY OF SPONTANEOUS GENERATION - ABIOGENESIS OR AUTOGENESIS - According to this theory, the existing living communities have originated from non-living organic matter with

Compare sql and pl/sql, Question 1 . Compare SQL and PL/SQL Question 2 ...

Question 1 . Compare SQL and PL/SQL Question 2 . Write a database trigger to implement the following check condition                          Given the following table

Using prior and next - collection method, Using PRIOR and NEXT The PRI...

Using PRIOR and NEXT The PRIOR(n) returns the index number that precede index n in a collection. The NEXT(n) returns the index number which succeed the index n. If n has no pr

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