Date Values Datatype Comparison Rules

2-6 Oracle Complex Event Processing CQL Language Reference

2.3.4.1 Implicit Datatype Conversion

Oracle CEP automatically converts a value from one datatype to another when such a conversion makes sense. Table 2–2 is a matrix of Oracle implicit conversions. The table shows all possible conversions marked with an X. Unsupported conversions are marked with a --. The following rules govern the direction in which Oracle CEP makes implicit datatype conversions: ■ During SELECT FROM operations, Oracle CEP converts the data from the stream to the type of the target variable if the select clause contains arithmetic expressions or condition evaluations. For example, implicit conversions occurs in the context of expression evaluation, such as c1+2.0, or condition evaluation, such as c1 2.0, where c1 is of type INTEGER. ■ Conversions from FLOAT to BIGINT are exact. ■ Conversions from BIGINT to FLOAT are inexact if the BIGINT value uses more bits of precision that supported by the FLOAT. ■ When comparing a character value with a TIMESTAMP value, Oracle CEP converts the character data to TIMESTAMP. ■ When you use a Oracle CQL function or operator with an argument of a datatype other than the one it accepts, Oracle CEP converts the argument to the accepted datatype wherever supported. ■ When making assignments, Oracle CEP converts the value on the right side of the equal sign = to the datatype of the target of the assignment on the left side. ■ During concatenation operations, Oracle CEP converts from noncharacter datatypes to CHAR. ■ During arithmetic operations on and comparisons between character and noncharacter datatypes, Oracle CEP converts from numeric types to CHAR as Table 2–2 shows. Table 2–2 Implicit Type Conversion Matrix to CHA R to BYT E to BOOL EAN to INT E GER to DOUBL E to BIGINT to FL O A T to TIMEST AMP to INT E R V A L from CHAR -- -- -- -- -- -- -- X -- from BYTE X -- -- -- -- -- -- -- -- from BOOLEAN -- -- X -- -- -- -- -- -- from INTEGER X -- -- -- X X X -- -- from DOUBLE X -- -- -- X -- -- -- -- from BIGINT X -- -- -- X -- X -- -- from FLOAT X -- -- -- X -- -- -- -- from TIMESTAMP X -- -- -- -- -- -- -- -- from INTERVAL X -- -- -- -- -- -- -- --