Data type conversion functions convert arguments from one data type to another.
Table 4-3 lists the data type conversion functions and their parameters.
Data type conversion function |
Parameters |
---|---|
BIGINTTOHEX |
( integer-expression ) |
CAST |
( expression AS data type ) |
CONVERT |
( data type, expression [ , format-style ] ) |
HEXTOBIGINT |
( hexadecimal-string ) |
HEXTOINT |
( hexadecimal-string ) |
INTTOHEX |
( integer-expr ) |
ISDATE |
( string ) |
ISNUMERIC |
( string ) |
The DATE, DATETIME, DATEFORMAT, and YMD functions that convert expressions to dates, timestamps, or strings based on a date format are listed in “Date and time functions”. The STRING function, which converts expressions to a string, is discussed in the section “String functions”.
The database server carries out many type conversions automatically. For example, if a string is supplied where a numerical expression is required, the string is automatically converted to a number. For more information on automatic data type conversions carried out by Sybase IQ, see “Data type conversions”.