Datatype Conversions

All columns handled by Sybase CEP have a datatype. Use conversion functions to convert data to the correct datatype.

Different datatypes support different operations and are treated differently by Sybase CEP. For example, some functions, such as AVG (average) or SUM (total) can be performed on numeric columns (such as INTEGER or FLOAT) but not on STRING columns.

Conversion functions can be used to convert data to the correct datatype. When data of one datatype is placed in a column of another datatype without an explicit conversion function, Syabse CEP attempts to convert the incoming data to the datatype of the receiving column automatically. For example, values of type INTEGER can be automatically converted to type LONG. If Sybase CEP cannot convert the incoming data to the column's datatype, it reports an error.

Each value subsequently placed in a column assumes the datatype of that column. For example, if you insert the value "1994-01-01" into a TIMESTAMP column, Sybase CEP treats the 1994-01-01 character string as a TIMESTAMP value, after verifying that it translates to a valid date.


Created March 8, 2010. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com