Literals; Character String Literals - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Literals

A literal is a constant you can use in an expression, in a statement, or as a parameter value. An
SQL literal can be one of these data types:
"Character String Literals" (page 274)
"Datetime Literals" (page 275)
"Interval Literals" (page 277)
"Numeric Literals" (page 279)

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.
You can specify either a string of characters or a set of hexadecimal code values representing the
characters in the string.
[_character-set | N]'string'
| [_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. The _character-set specification of the
string literal should correspond with the character set of the column definition, which is
either ISO88591 or UCS2. The _character-set specification does not limit the character
set encoding of the string literal to ISO88591 or UCS2. Although you can specify only ISO88591
or UCS2 for character column definitions and string literals in Neoview SQL, the character
set configuration of your Neoview platform permits you to use character string data encoded
in other character sets. If you omit the _character-set specification, Neoview SQL uses
the default character set for the character set configuration of your Neoview platform. For
more information, see the Neoview Character Sets Administrator's Guide.
N
associates the string literal with the character set of the NATIONAL CHARACTER (NCHAR)
data type. The character set for NCHAR is determined during the installation of Neoview
SQL. This value can be either UCS2 (the default) or ISO88591.
'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.
X
indicates the hexadecimal string.
'hex-code-value'
represents the code value of a character in hexadecimal form enclosed in single quotes. It
must contain an even number of hexadecimal digits. For UCS2, each hex-code-value must
be of four hexadecimal digits long. For ISO88591, each value must be two digits long. If
hex-code-value is improperly formatted (for example, it contains an invalid hexadecimal
digit or an odd number of hexadecimal digits), an error is returned.
274
SQL Language Elements
A series of characters enclosed in single quotes. Example:
'Planning'
Begins with keyword DATE, TIME, or TIMESTAMP and
followed by a character string. Example: DATE
'1990-01-22'
Begins with keyword INTERVAL and followed by a
character string and an interval qualifier. Example:
INTERVAL '2-7' YEAR TO MONTH
A simple numeric literal (one without an exponent) or a
numeric literal in scientific notation. Example: 99E-2

Advertisement

Table of Contents
loading

Table of Contents