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
Need Azure CRM Web Application with two-factor authentication We presently have a CRM-like database stored on MS Azure that we presently access over an MS Access application. It

Logical Connectives - SQL SQL's extended truth tables in which the symbol, for unknown, appears along with the usual T and F. Negation (NOT, ¬) Conjunction (

I would like to have a custom MS Access database designed and coded that would help me schedule my customer's orders and that would help me track my employees production output and

Consider the schema for FreeChecking Bank, that we designed given below. Translate the given ER schema into SQL CREATE TABLE statements (indicating primary key, unique and foreign

THEO R Y OF ETERNITY OF LIFE (PRAYER - 1880) - The theory of eternity of life, also called the steady-state theory , states that life has ever been in existence as at presen

Bulk Fetching The illustration below shows that you can bulk-fetch from a cursor into one or more collections: DECLARE TYPE NameTab IS TABLE OF emp.ename%TYPE; TYPE S

Cursors   To execute the multi-row query, the Oracle opens an unnamed work region which stores the processing information. The cursor names the work region, access the informa

Nested Tables versus Index-by Tables The Index-by tables and nested tables are just similar. For e.g.  They have similar structure and their individual elements are accessed in

Deriving Predicates from Predicates in SQL The corresponding section in the theory book describes how predicates can be derived from predicates using (a) the logical connectiv

Pass the nulls to a dynamic SQL: Passing Nulls: Assume that you want to pass the nulls to a dynamic SQL statement. For illustration, you may write the EXECUTE IMMEDIATE