Supported Query Language Literals
Query language expressions can contain literals as well as operators and attribute names. The client supports many types of literals.
-
boolean
. Boolean value, eitherTRUE
orFALSE
. -
integer
andlong
. Typelong
if it is suffixed with the ASCII letter L. Otherwise it is of typeint
. -
floating point
.Type float if it is suffixed with an ASCII letter F. Otherwise its type is double and it can optionally be suffixed with an ASCII letter D . A double or floating point literal can optionally include an exponent suffix of E or e, followed by a signed or unsigned number. -
string
. Delimited by single quotation marks. Embedded single quotation marks are doubled. For example, the character string'Hello'
evaluates to the valueHello
, while the character string'He said, ''Hello'''
evaluates toHe said, 'Hello'
. Embedded newlines are kept as part of the string literal. -
char
. Typechar
if it is a string literal prefixed by the keywordCHAR
; otherwise it is of typestring
. The CHAR literal for the single quotation mark character isCHAR ''''
(four single quotation marks). -
date
.java.sql.Date
object that uses the JDBC format prefixed with theDATE
keyword:DATE yyyy-mm-dd
. In the Date,yyyy
represents the year,mm
represents the month, anddd
represents the day. The year must be represented by four digits; a two-digit shorthand for the year is not allowed. -
time
. Not supported. -
timestamp
. Not supported. -
NIL
. Equivalent alternative ofNULL
. -
NULL
. Same asnull
in Java. -
UNDEFINED
. Special literal that is a valid value for any data type. AnUNDEFINED
value is the result of accessing an attribute of a null-valued attribute. If you access an attribute that has an explicit value of null, then it is not undefined. For example, if a query accesses the attributeaddress.city
and address is null, then the result is undefined. If the query accessesaddress
, then the result is not undefined, it is null.