Literal values represent fixed values. These can be any of the 'standard' data types. For information about data types, see Data types.

Syntax rules
  • Integer values will be assigned an integral data type big enough to hold the value (integer, long, or biginteger).

  • Floating point values will always be parsed as a double.

  • The keyword 'null' is used to represent an absent or unknown value and is inherently untyped. In many cases, a null literal value will be assigned an implied type based on context. For example, in the function '5 + null', the null value will be assigned the type 'integer' to match the type of the value '5'. A null literal used in the SELECT clause of a query with no implied context will be assigned to type 'string'.

Some examples of simple literal values are:

Example: Escaped single tick
'isn"t true'
Example: Scientific notation
Example: exact numeric type BigDecimal
Example: Unicode character
Example: Binary

Date/Time literals can use either JDBC Escaped literal syntax:

Example: Date literal
Example: Time literal
Example: Timestamp literal

Or the ANSI keyword syntax:

Example: Date literal
DATE '...'
Example: Time literal
TIME '...'
Example: Timestamp literal

Either way, the string literal value portion of the expression is expected to follow the defined format - "yyyy-MM-dd" for date, "hh:mm:ss" for time, and "yyyy-MM-dd[ hh:mm:ss[.fff…]]" for timestamp.

results matching ""

    No results matching ""