Element Literal Value
The diagram for Literal Collection refers
to this section. Elements of a collection can be literal values for
the following data types.
For a Collection of Type | Literal Value Syntax |
---|---|
BOOLEAN | t or f , representing
TRUE or FALSE as a quoted string |
CHAR, VARCHAR, NCHAR, NVARCHAR, CHARACTER VARYING, LVARCHAR, DATE | Quoted String |
DATETIME | Literal DATETIME |
DECIMAL, MONEY, FLOAT, INTEGER, INT8, SMALLFLOAT, SMALLINT | Literal Number |
INTERVAL | Literal INTERVAL |
Opaque data types | Quoted String. The string literal must be recognized by the input support function for the associated opaque type. |
Row Type | Literal Row. When the collection element type is a named ROW type, you do not need to cast the inserted values to the named ROW type. |
Important: You cannot specify
the simple-large-object data types (BYTE and TEXT) as the element
type for a collection.
Quoted strings must be specified with a different type of quotation mark than the quotation marks that encompass the collection, so that the database server can parse the quoted strings. Thus, if you use double ( " ) quotation marks to specify the collection, use single ( ' ) quotation marks to specify individual, quoted-string elements. (In databases where delimited identifiers are enabled, however, double quotation marks are not valid, except to delimit SQL identifiers.)