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.
*Timestamps can be explicitly cast to strings. Casting to other types is not permitted.
*Strings can be implicitly or explicitly cast to timestamps. For explicit casting, the strings must be of the form:
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.
*All types can be implicitly cast to the same type.
Table 6‑5 summarizes the casting rules for Actuate SQL data types.
Table 6‑5 Casting rules for Actuate SQL types 
 
To
INTEGER
To
DECIMAL
To
DOUBLE
To VARCHAR
To TIMESTAMP
From INTEGER
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