Literal Collection

Use the Literal Collection segment to specify values for a collection data type. For the syntax of expressions that return values of individual elements within a collection, see Collection Constructors.


Literal Collection

2.1 SET
2.1 LIST {%Literal Data}
Literal Data

1+ ,
1  %Element Literal Value1
1   %Nested Quotation Marks2  %Literal Collection  %Nested Quotation Marks2


You can specify literal collection values for SET, MULTISET, or LIST data types.

To specify a single literal-collection value, specify the collection type and the literal values. The following SQL statement inserts four integer values into a column called set_col that was declared as SET(INT NOT NULL):
INSERT INTO table1 (set_col) VALUES (SET{6, 9, 9, 4});
Specify an empty collection with an empty pair of braces ( { } ) symbols. This example inserts an empty list into a column list_col that was declared as LIST(INT NOT NULL):
INSERT INTO table2 (list_col) VALUES ('LIST{}');

A pair of single ( ' ) or double ( " ) quotation marks can delimit the collection. Double quotation marks are not valid, however, in databases where delimited identifiers are enabled, except to delimit SQL identifiers.

If you are passing a literal collection as an argument to an SPL routine, make sure that there is a blank space between the parentheses that surround the arguments and quotation marks that indicate the beginning and end of the literal collection.