Text literals
A text literal is a string that is enclosed by single quotation marks (') or double quotation marks ("). If you enable the ANSI_QUOTES mode, you can use only single quotation marks (') to enclose strings.
Numeric literals
Decimal numeric literals are divided into floating-point values and exact values that consist of integer and fixed-point values. Values can include a decimal point (.) as a decimal separator. Values that are prefixed with a minus sign (-) represent negative values.
Hexadecimal numeric literals only support integer values that are prefixed with 0X, and allow letters from A to F. All letters are case-insensitive.
Datetime
Datetime literals can be in the text or numeric format.
- In the text format, you can use full separators, for example,
'2015-07-21 12:34:56.789'. You can also use no separators, for example,'20150721'.
The numeric format allows you to use only a decimal point (
.) to separate the seconds and microseconds, for example,20150721123456.789.A decimal point (
.) must be used between seconds and microseconds. If you require other separators, we recommend that you use only common separators such as hyphens (-), forward slashes (/), and colons (:).
Escape characters
An escape character is a backslash (\) that invokes an alternative interpretation on the following characters in a character sequence. Escape characters are case-sensitive. For example, \b represents the backspace and \B represents the B character.
The following table lists all escape characters.
| Escape character | Description |
|---|---|
\b |
A backspace. |
\f |
A form feed. |
\n |
A line feed. |
\r |
A carriage return. |
\t |
A tab character. |
\\ |
A backslash (\). |
\' |
A single quotation mark ('). |
\" |
A double quotation mark ("). |
\_ |
An underscore (_). |
\% |
A percent sign (%). |
\0 |
NULL |
\Z |
ASCII 26 (Ctrl+Z). |