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
Parameter and Keyword Description: collection_name: This keyword identifies the index-by table, nested table, or varray formerly declared within the present scope. cu

CURRVAL and NEXTVAL The series is a schema object which generates the sequential numbers. Whenever you form a sequence, you can specify its primary value and an increment. T

Grouping and Ungrouping in SQL Example specifying EXAM_MARK in place of COURSE in the main FROM clause. Example: Obtaining C_ER2 from EXAM_MARK SELECT CourseId, CAST

Raise_application_error -  procedure of package DBMS_STANDARD , allows to issue an user_defined error messages by stored sub-program or database trigger.

V ariables and Constants in PL/SQL The PL/SQL permits you to declare constants and variables, and then use them in SQL and procedural statements anywhere in the expression. Th

Fetching from a Cursor Variable The FETCH statement retrieve rows one at a time from the product set of a multi-row query. The syntax for the same is as shown: FETCH {curso

Assignments in pl/sql The Variables and constants are initialized every time a block or subprogram is entered. By default, the variables are initialized to NULL. Therefore, unle

Block Structure The PL/SQL is a block-structured language. That is, the fundamental units (procedures, anonymous blocks, and functions) that make up a PL/SQL program are logi

EXIT-WHEN The EXIT-WHEN statement permits a loop to complete conditionally. Whenever the EXIT statement is encountered, the condition in the WHEN clause is computed. When the co

Advantages of Invoker Rights The Invoker-rights routines centralize the data retrieval. They are particularly helpful in applications which store data in various schemas. In su