SQL/MX 2.x Reference Manual (H06.04+)

SQL/MX Language Elements
HP NonStop SQL/MX Reference Manual540440-003
6-60
Literals
Literals
A literal is a constant you can use in an expression, in a statement, or as a parameter
value. Literals are stored in columns of tables according to how you specify the column
definitions in a CREATE TABLE statement. An SQL literal can be one of these data
types:
Character String Literals
Considerations for Character String Literals
SQL/MP Considerations for Character String Literals
Examples of Character String Literals
A character string literal is a series of characters enclosed in single quotes.
_character-set
specifies the character set ISO88591, UCS2, KANJI, or KSC5601. If you omit the
character set specification, the default is whatever character set default you set
when you installed NonStop SQL/MX. See Character Sets
on page 6-3.
N
associates the system default character set with the string literal. The default is set
by the value of the NATIONAL_CHARSET attribute during SQL/MX installation.
See National Character Set
on page 10-47.
'string'
is a series of any input characters enclosed in single quotes. A single quote within
a string is represented by two single quotes (''). A string can have a length of
zero if you specify two single quotes ('') without a space in between.
Character String Literals on
page 6-60
A series of characters enclosed in single quotes.
Example: 'Planning'
Datetime Literals
on
page 6-64
Begins with keyword DATE, TIME, or TIMESTAMP and
followed by a character string.
Example: DATE '1990-01-22'
Interval Literals
on page 6-67 Begins with keyword INTERVAL and followed by a
character string and an interval qualifier.
Example: INTERVAL '2-7' YEAR TO MONTH
Numeric Literals
on page 6-71 A simple numeric literal (one without an exponent) or a
numeric literal in scientific notation. Example: 99E-2
[_character-set | N]'string'