Datasheet
22
Chapter 1
Introducing SQL
literal is 4,000 bytes. Single quotation marks can be included in the literal text value by
preceding it with another single quotation mark. Here are some examples of text literals:
‘The Quick Brown Fox’
‘That man’’s suit is black’
‘And I quote: “This will never do.” ‘
‘12-SEP-2001’
Alternatively, you can use Q or q quoting, which provides a range of delimiters. The
syntax for using the
Q/q quoting with a quote-delimiter text literal is as follows:
[Q|q]’ <quote_delimiter> <text literal> <quote_delimiter>’
<quote_delimiter>
is any character except a space, tab, or carriage return. The quote
delimiter can be a single quotation mark, but make sure inside the text literal a single quo-
tation mark is not immediately followed by another single quotation mark. If the opening
quote delimiter is
[ or { or < or (, then the closing quote must be the corresponding ] or }
or
> or ). For all other quote delimiters, the opening quote delimiter must be the same as
the closing quote delimiter. Here are some examples of text literals using the alternative
quoting mechanism:
q’<The Quick Brown Fox>’
Q’#The Quick Brown Fox#’
q’{That man’s suit is black}’
Q’(And I quote: “This will never do.” )’
Q’”And I quote: “This will never do.” “‘
q’[12-SEP-2001]’
Numeric Literals
Integer literals can be any number of numerals, excluding a decimal separator and up to 38
digits long. Here are two examples:
24
–456
Number and floating-point literals can include scientific notation, as well as digits and
the decimal separator.
E or e represents a number in scientific notation; the exponent can be
in the range of –130 to 125. If the literal is followed by an
f or F, it is treated as a BINARY_
FLOAT
datatype. If the literal is followed by a d or D, it is treated as a BINARY_DOUBLE datatype.
Here are some examples:
24.0
–345.65
23E-10
95127c01.indd 22 2/18/09 6:37:09 AM