Casting rules
The following casting rules apply:
*
Integers can be implicitly cast to decimals and doubles. For implicit casts to decimals, the resulting decimals have a precision of 10 and a scale of 0. Integers can be explicitly cast to these types, as well as to strings.
*
Decimals can be implicitly cast to doubles. Decimals can be explicitly cast to doubles, as well as to integers and strings. Conversion to integer type may result in rounding or truncation of data.
*
Doubles can be explicitly cast to strings, as well as to integers and decimals. Conversion to decimal and integer types may result in rounding or truncation of data.
*
*
yyyy-MM-dd hh:mm:ss.fff
Strings can be explicitly cast to integers, decimals, and doubles.
*
Because databases vary in their implementation, casts to strings do not have a defined format. For example, the same value can be represented as 6E5, 60000, or 60000.00.
*
Table 7-5 summarizes the casting rules for Actuate SQL data types.
To
INTEGER
To
DECIMAL
To
DOUBLE
To VARCHAR
To TIMESTAMP
Implicit casting occurs
Implicit casting occurs
Implicit casting occurs
Explicit casting required
Casting not permitted
From DECIMAL
Explicit casting required
Implicit casting occurs
Implicit casting occurs
Explicit casting required
Casting not permitted
From
DOUBLE
Explicit casting required
Explicit casting required
Implicit casting occurs
Explicit casting required
Casting not permitted
From VARCHAR
Explicit casting required
Explicit casting required
Explicit casting required
Implicit casting occurs
Implicit casting occurs
From TIMESTAMP
Casting not permitted
Casting not permitted
Casting not permitted
Explicit casting required
Implicit casting occurs

Additional Links:

Copyright Actuate Corporation 2012