Row counterparts of table operators - sql, PL-SQL Programming

Row Counterparts of Table Operators

SQL does not have counterparts tuple rename, tuple projection, tuple extension, tuple join and tuple compose. To obtain the same effects as these operators on row r, one has first to derive the table t consisting of just r, then apply the SQL counterpart of the corresponding relational operator on t, putting parentheses around the table expression so that, so long as the context is appropriate, it becomes a row subquery. For example, if r has fields named a, b, and c, we can simulate a tuple renaming of a tuple projection to obtain the row consisting of just a and b, with b renamed to x, by (SELECT a, x FROM VALUES (r) AS t(a, x, c)).

The snag here is that the columns of a VALUES expression have implementation-dependent names, so we cannot rely on the field names of r being propagated to the table. We therefore have to specify the names in parentheses after the range variable name, t. At least that gives us the slight short cut of renaming b as x on the fly, so to speak.

Posted Date: 1/18/2013 7:05:19 AM | Location : United States







Related Discussions:- Row counterparts of table operators - sql, Assignment Help, Ask Question on Row counterparts of table operators - sql, Get Answer, Expert's Help, Row counterparts of table operators - sql Discussions

Write discussion on Row counterparts of table operators - sql
Your posts are moderated
Related Questions
%FOUND Until the SQL data manipulation statement is executed, the %FOUND yields NULL. Afterward, the %FOUND yields TRUE, when an INSERT, UPDATE, or DELETE statement affected o

Renaming Columns - SQL SQL has no direct counterpart of RENAME. To derive the table on the right in Figure 4.4 from the table on the left, Tutorial D has IS_CALLED RENAME ( St

What are the rates for help in writing PL/SQL procedures and functions?

The requirements as follows: Create a folder called "SECURITY" on the server and upload all your project files to that folder. Please note, the "SECURITY" folder is NOT to be IN

UNNEST operator in SQL The inverse operator of GROUP is UNGROUP. SQL has an operator, UNNEST, that can be used for similar purposes, but its method of invocation is somewhat p

What Are Subprograms? The Subprograms are named PL/SQL blocks which can take parameters and be invoked. The PL/SQL has 2 types of subprograms known as the procedure s and func

Using LIMIT For nested tables, that have no maximum size, the LIMIT returns NULL. For varrays, the LIMIT returns the maximum number of elements that a varray can have (that yo

Using DELETE This process has three forms. The DELETE removes all elements from the collection. DELETE(n) removes the nth element from the nested table. When n is null, then D

Multiset types - SQL An SQL multiset is what in mathematics is also known as a bag-something like a set except that the same element can appear more than once. The body of an

Introduction Oracle 9i - it was made public in the year 2001 with over 400 features, and graphics, it has merged the traditional business with modern internet application