Integer Literals Numeric Literals

Basic Elements of Oracle CQL 2-9 integer::= where digit is one of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. An integer can store a maximum of 32 digits of precision. Here are some valid integers: 7 +255

2.4.2.2 Floating-Point Literals

You must use the number or floating-point notation to specify values whenever number or n appears in expressions, conditions, Oracle CQL functions, and Oracle CQL statements in other parts of this reference. The syntax of number follows: number::= where ■ + or - indicates a positive or negative value. If you omit the sign, then a positive value is the default. ■ digit is one of 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9. ■ f or F indicates that the number is a 64-bit binary floating point number of type FLOAT. ■ d or D indicates that the number is a 64-bit binary floating point number of type DOUBLE. If you omit f or F and d or D, then the number is of type INTEGER. The suffixes f or F and d or D are supported only in floating-point number literals, not in character strings that are to be converted to INTEGER. For example, if Oracle CEP is expecting an INTEGER and it encounters the string 9, then it converts the string to the Java Integer 9. However, if Oracle CEP encounters the string 9f, then conversion fails and an error is returned. A number of type INTEGER can store a maximum of 32 digits of precision. If the literal requires more precision than provided by BIGINT or FLOAT, then Oracle CEP truncates the value. If the range of the literal exceeds the range supported by BIGINT or FLOAT, then Oracle CEP raises an error. If your Java locale uses a decimal character other than a period ., then you must specify numeric literals with text notation. In these cases, Oracle CEP automatically converts the text literal to a numeric value. Note: You cannot use this notation for floating-point number literals. 2-10 Oracle Complex Event Processing CQL Language Reference For example, if your Java locale specifies a decimal character of comma ,, specify the number 5.123 as follows: 5,123 Here are some valid NUMBER literals: 25 +6.34 0.5 -1 Here are some valid floating-point number literals: 25f +6.34F 0.5d -1D

2.4.3 Datetime Literals

Oracle CEP supports datetime datatype TIMESTAMP. Datetime literals must not exceed 64 bytes. All datetime literals must conform to one of the java.text.SimpleDateFormat format models that Oracle CQL supports. For more information, see Section 2.5.2, Datetime Format Models . Currently, the SimpleDateFormat class does not support xsd:dateTime. As a result, Oracle CQL does not support XML elements or attributes that use this type. For example, if your XML event uses an XSD like Example 2–6 , Oracle CQL cannot parse the MyTimestamp element. Example 2–6 Invalid Event XSD: xsd:dateTime is Not Supported xsd:element name=ComplexTypeBody xsd:complexType xsd:sequence xsd:element name=MyTimestamp type=xsd:dateTime xsd:element name=ElementKind type=xsd:string xsd:element name=name type=xsd:string xsd:element name=node type=SimpleType xsd:sequence xsd:complexType xsd:element Oracle recommends that you define your XSD to replace xsd:dateTime with xsd:string as Example 2–7 shows. Example 2–7 Valid Event XSD: Using xsd:string Instead of xsd:dateTime xsd:element name=ComplexTypeBody xsd:complexType xsd:sequence xsd:element name=MyTimestamp type=xsd:string xsd:element name=ElementKind type=xsd:string xsd:element name=name type=xsd:string xsd:element name=node type=SimpleType xsd:sequence xsd:complexType xsd:element