|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' 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' to be different.
Also, trailing blanks are significant within string literals, so
'abc ' are different. Trailing blanks in a literal are never trimmed.
The Boolean values
FALSE cannot be inserted into a database column.
Several examples of numeric literals follow:
Several examples of character literals follow:
A few examples of string literals follow: