Implicit Datatype Conversion Datatype Conversion

Basic Elements of Oracle CQL 2-7

2.3.4.2 Explicit Datatype Conversion

You can explicitly specify datatype conversions using Oracle CQL conversion functions. Table 2–3 shows Oracle CQL functions that explicitly convert a value from one datatype to another. Unsupported conversions are marked with a --.

2.3.4.3 SQL Datatype Conversion

Using an Oracle CQL processor, you can specify a relational database table as an event source. You can query this event source, join it with other event sources, and so on. When doing so, you must observe the SQL and Oracle CEP data type equivalents that Oracle CEP supports. For more information, see: ■ Section 18.2.5, Relational Database Table Query ■ SQL Column Types and Oracle CEP Type Equivalents in the Oracle Complex Event Processing Developers Guide for Eclipse

2.3.4.4 Oracle Data Cartridge Datatype Conversion

At run time, Oracle CEP maps between Oracle CQL and data cartridge datatypes according to the data cartridge’s implementation. For more information, see: ■ Oracle Java data cartridge: Section 15.1.4, Datatype Mapping ■ Oracle Spatial: Section 16.1.3, Datatype Mapping

2.3.4.5 User-Defined Function Datatype Conversion

At run time, Oracle CEP maps between the Oracle CQL datatype you specify for a user-defined function’s return type and its Java datatype equivalent. For more information, see Section 13.1.2, User-Defined Function Datatypes . Table 2–3 Explicit Type Conversion Matrix to CHA R to B Y TE to BOOL EAN to INT E GER to DOUBL E to BIGINT to F L O A T to TIMEST AMP to INT E R V A L from CHAR -- hextoraw -- -- -- -- -- to_timestamp -- from BYTE -- rawtohex -- -- -- -- -- -- -- from BOOLEAN from INTEGER to_char -- to_boolean -- to_double to_bigint to_float -- -- from DOUBLE to_char -- -- -- -- -- -- -- -- from LONG -- -- -- -- -- -- -- to_timestamp -- from BIGINT to_char -- to_boolean -- to_double -- to_float -- -- from FLOAT to_char -- -- -- to_double -- -- -- -- from TIMESTAMP to_char -- -- -- -- -- -- -- -- from INTERVAL to_char -- -- -- -- -- -- -- -- 2-8 Oracle Complex Event Processing CQL Language Reference

2.4 Literals

The terms literal and constant value are synonymous and refer to a fixed data value. For example, JACK, BLUE ISLAND, and 101 are all text literals; 5001 is a numeric literal. Oracle CEP supports the following types of literals in Oracle CQL statements: ■ Text Literals ■ Numeric Literals ■ Datetime Literals ■ Interval Literals

2.4.1 Text Literals

Use the text literal notation to specify values whenever const_string, quoted_ string_double_quotes, or quoted_string_single_quotes appears in the syntax of expressions, conditions, Oracle CQL functions, and Oracle CQL statements in other parts of this reference. This reference uses the terms text literal, character literal , and string interchangeably. Text literals are enclosed in single or double quotation marks so that Oracle CEP can distinguish them from schema object names. You may use single quotation marks ’ or double quotation marks . Typically, you use double quotation marks. However, for certain expressions, conditions, functions, and statements, you must use the quotation marks as specified in the syntax given in other parts of this reference: either quoted_string_double_quotes or quoted_ string_single_quotes . If the syntax uses simply const_string, then you can use either single or double quotation marks. If the syntax uses the term char, then you can specify either a text literal or another expression that resolves to character data. When char appears in the syntax, the single quotation marks are not used. Oracle CEP supports Java localization. You can specify text literals in the character set specified by your Java locale. For more information, see: ■ Section 1.2.1, Lexical Conventions ■ Section 2.9, Schema Object Names and Qualifiers ■ const_string::= on page 7-12

2.4.2 Numeric Literals

Use numeric literal notation to specify fixed and floating-point numbers.

2.4.2.1 Integer Literals

You must use the integer notation to specify an integer whenever integer appears in expressions, conditions, Oracle CQL functions, and Oracle CQL statements described in other parts of this reference. The syntax of integer follows: