Sybase CEP supports several categories of scalar functions.
Function Type |
Description |
---|---|
Numeric |
Numeric functions are used with numeric values (INTEGER, LONG and FLOAT). Some numeric functions can also be used with INTERVAL and TIMESTAMP values. Examples of numeric functions include ROUND (rounds a float value to the nearest integer), SQRT (returns the square root of a value), and MIN (returns the smallest value from a list of values). |
String |
String functions are used with STRING values and usually (but not always) return a STRING value. Examples of string functions include LEFT (returns the left-most characters of a string), RTRIM (removes trailing spaces from a string), and REPLACE (replaces occurrences of one substring with another substring). |
Conversion |
Conversion functions convert data values of various datatypes to the datatype specified by the function name. For example, the TO_STRING function converts a value to the STRING datatype. Not all conversions between different data types are permitted in Sybase CEP. The rules governing valid datatype conversions are discussed in Sybase CEP CCL Reference. |
XML |
There are special scalar functions which are designed to correctly handle XML data. For more information on these functions, please see Sybase CEP CCL Reference . |
Miscellaneous |
There are several miscellaneous functions including the COALESCE function, which returns the first non-null expression in a list of expressions, and the NOW function, which returns a timestamp corresponding to the current time. |
Scalar functions take one or more expression values as arguments and return a single result value for each row of data processed by a query. These functions can appear in most expressions, and are used most often in SELECT clauses and WHERE clauses.
For a complete explanation of the scalar functions used by CCL, please see Sybase CEP CCL Reference.
In addition to the built-in functions provided by Sybase CEP, you can define your own functions. Please see the Sybase CEP CCL Reference Guide and the Sybase CEP Integration Guide for more information about creating and using user-defined functions.