PL/SQL User's Guide and Reference Release 2 (9.2) Part Number A96624-01 |
|
PL/SQL Language Elements, 27 of 52
A literal is an explicit numeric, character, string, or Boolean value not represented by an identifier. The numeric literal 135 and the string literal 'hello world'
are examples. For more information, see "Literals".
This is a member of the PL/SQL character set. For more information, see "Character Set".
This is one of the numerals 0 .. 9.
This is a predefined Boolean value.
Two kinds of numeric literals can be used in arithmetic expressions: integers and reals. Numeric literals must be separated by punctuation. Spaces can be used in addition to the punctuation.
A character literal is an individual character enclosed by single quotes (apostrophes). Character literals include all the printable characters in the PL/SQL character set: letters, numerals, spaces, and special symbols.
PL/SQL is case sensitive within character literals. So, for example, PL/SQL considers the literals 'Q'
and 'q'
to be different.
A string literal is a sequence of zero or more characters enclosed by single quotes. The null string (''
) contains zero characters. To represent an apostrophe within a string, write two single quotes. PL/SQL is case sensitive within string literals. So, for example, PL/SQL considers the literals 'white'
and 'White'
to be different.
Also, trailing blanks are significant within string literals, so 'abc'
and 'abc '
are different. Trailing blanks in a literal are never trimmed.
The Boolean values TRUE
and FALSE
cannot be inserted into a database column.
Several examples of numeric literals follow:
25 6.34 7E2 25e-03 .1 1. +17 -4.4
Several examples of character literals follow:
'H' '&' ' ' '9' ']' 'g'
A few examples of string literals follow:
'$5,000' '02-AUG-87' 'Don''t leave without saving your work.'
|
Copyright © 1996, 2002 Oracle Corporation. All Rights Reserved. |
|