Table literals - sql, PL-SQL Programming

Table Literals - SQL

One might expect SQL to support table literals in the manner illustrated in Example 2.2, but in fact that is not a legal SQL expression.

Example: Not a Table Literal

TABLE (

ROW (StudentId 'S1', CourseId 'C1', Name 'Anne'),

ROW (StudentId 'S1', CourseId 'C2', Name 'Anne'),

ROW (StudentId 'S2', CourseId 'C1', Name 'Boris'),

ROW (StudentId 'S3', CourseId 'C3', Name 'Cindy'),

ROW (StudentId 'S4', CourseId 'C1', Name 'Devinder') 

);

It is illegal because row literals in SQL do not use column names. Instead, the column values must be written in the appropriate order, reflecting the order of the columns of the table, as in

ROW ('S1', 'C1', 'Anne')

Moreover, the word VALUES is used in place of TABLE, parentheses is not used around the list of row literals, and the key word ROW is in fact optional.

Posted Date: 1/18/2013 2:13:23 AM | Location : United States







Related Discussions:- Table literals - sql, Assignment Help, Ask Question on Table literals - sql, Get Answer, Expert's Help, Table literals - sql Discussions

Write discussion on Table literals - sql
Your posts are moderated
Related Questions
Functions The function is a subprogram which can take parameters and be invoked. Normally, you can use a function to calculate a value. The function has 2 sections: the specifi

Subprograms The PL/SQL has two types of subprograms known as the procedures and functions that can take parameters and be invoked. As the following example represents, a subp

Updating Variables For assignment, SQL uses the key word SET, as in SET X = X + 1 (read as "set X equal to X+1") rather than X: = X + 1 as found in many computer languages.

Error Handling The PL/SQL makes it easy to detect and process the predefined and user-defined error conditions known as exceptions. Whenever an error occurs, an exception is ra

Components of an Object Type: An object type encapsulates the operations and data. Therefore, you can declare the methods and attributes in an object type specification, but no

Collections:   The collection is an ordered group of elements, all of similar type (for illustration, the grades for a class of students). Each element has an exclusive subsc

Project Description: I am looking to change FullCalendar to add/delete sql server data when events are removed or dropped from Calendar. Events should only be included by dra

Conditionals - SQL At first sight SQL does not appear to have a single operator for expressing logical implication. In this respect it would be in common with most programming

Updating Tables in SQL The topic of updating by describing the assignment operator, ":=" in Tutorial D. SQL uses a different syntax for assignment, using the key word SET and

Write a stored procedure that accepts the post code in which the customer resides as the input parameter. The procedure should then use an explicit cursor to display comprehensive