table literals - sqlone might expect sql to


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.

Request for Solution File

Ask an Expert for Answer!!
PL-SQL Programming: table literals - sqlone might expect sql to
Reference No:- TGS0180809

Expected delivery within 24 Hours