Neoview SQL Reference Manual (R2.3)
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:
A series of characters enclosed in single quotes. Example:
'Planning'
“Character String Literals” (page 233)
Begins with keyword DATE, TIME, or TIMESTAMP and
followed by a character string. Example: DATE
'1990-01-22'
“Datetime Literals” (page 235)
Begins with keyword INTERVAL and followed by a
character string and an interval qualifier. Example:
INTERVAL '2-7' YEAR TO MONTH
“Interval Literals” (page 236)
A simple numeric literal (one without an exponent) or a
numeric literal in scientific notation. Example: 99E-2
“Numeric Literals” (page 238)
Character String Literals
• “Considerations for Character String Literals”
• “Examples of Character String Literals”
A character string literal is a series of characters enclosed in single quotes. For more information
on character string literals, see the Neoview Character Sets Administrator's Guide.
[_character-set | N]'string'
_character-set
specifies the character set ISO88591 and UCS2. If you omit the character set specification, the
default is whatever character set default you set when you installed Neoview SQL. For more
information about the character set specification, see the Neoview Character Sets Administrator's
Guide.
N
associates the system default character set with the string literal. The default is set by the
value of the NATIONAL_CHARSET attribute during the Neoview SQL installation.
'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.
You can specify string literals using hexadecimal code values in DML statements.
[_character-set | N] X'hex-code-value... '
| [_character-set | N] X'[space…]hex-code-value[[space…]
hex-code-value...][space…]'
_character-set
specifies the character set ISO88591 or UCS2. If you omit the character set specification, the
default is whatever character set default you set when you installed Neoview SQL. For more
information about the character set specification, see the Neoview Character Sets Administrator's
Guide.
N
associates the system default character set with the string literal. The default is set by the
value of the NATIONAL_CHARSET attribute during the Neoview SQL installation.
X
represents the X in hexadecimal notation.
Literals 233