Data Type Conversion
Description
Data type conversion can be explicit by using custom functions, or implicit depending on context.
Explicit conversion
Currently, the following explicit data type conversion functions are available:
Implicit conversion
In some functions and operators, there will be an implicit data type conversion which is done internally, without any loss of information in the output. Examples include:
Other functions with type changes
There are a number of other functions which take one data type as input, and return another. These are not conversion functions, since the semantics of the functions inherently imply a loss of information. Examples include:
DATE projection functions, such as CALENDAR_WEEK, HOURS and YEAR will extract part of the DATE input and return that information as an INT.
Specifically for DATE handling, functions are available which use a non-DATE type as input or output:
ADD_SECONDS converts INT input to DATE output. Similar conversions are available in the other DateTime Modification functions.
SECONDS_BETWEEN converts DATE input to FLOAT output. Similar conversions are available in the other DateTime Difference functions.