Oracle® Business Intelligence Server Administration Guide > Oracle BI Server SQL Reference > SQL Reference >
A literal is a nonnull value corresponding to a given data type. Literals are typically constant values; that is, they are values that are taken literally as is, without changing them at all. A literal value has to comply with the data type it represents.
SQL provides mechanisms for expressing literals in SQL statements. This section describes how to express each type of literal in SQL.
A character literal represents a value of CHARACTER or VARCHAR data type. To express a character literal, surround the character string with single quotes ( ' ). The length of the literal is determined by the number of characters between the single quotes.
The SQL 92 standard defines three kinds of typed datetime literals, in the following formats:
TIMESTAMP 'yyyy-mm-dd hh:mm:ss'
These formats are fixed and are not affected by the format specified in the NQSConfig.INI file for the parameters DATE_DISPLAY_FORMAT, TIME_DISPLAY_FORMAT, or DATE_TIME_DISPLAY_FORMAT. To express a typed datetime literal, use the keywords DATE, TIME, or TIMESTAMP followed by a datetime string enclosed in single quote marks. Two digits are required for all nonyear components even if the value is a single digit.
A numeric literal represents a value of a numeric data type (for example, INTEGER, DECIMAL, and FLOAT). To express a numeric literal, type the number as part of a SQL statement.
Do not surround numeric literals with single quotes; doing so expresses the literal as a character literal.
To express an integer constant as a literal, type the integer as part of a SQL statement (for example, in the SELECT list). The integer can be preceded with either a plus sign (+) or minus sign (-) to indicate the integer is a positive or negative number, respectively.
To express a decimal literal, type a decimal number. The decimal can be preceded with either a plus sign (+) or minus sign (-) to indicate the integer is a positive or negative number, respectively.
To express floating point numbers as literal constants, type a decimal literal followed by the letter 'E' (either uppercase or lowercase) and followed by the plus sign (+) or the minus sign (-) to indicate a positive or negative exponent. No spaces are allowed between the integer, the letter 'E', and the sign of the exponent.