BIGINTTOHEX function [Data type conversion]

Function

Returns the hexadecimal equivalent in VARCHAR(16) of a decimal integer.

Syntax

BIGINTTOHEX ( integer-expression )

Parameters

integer-expression The integer to be converted to hexadecimal.

Examples

The following statement returns the value 0000000000000009:

SELECT BIGINTTOHEX(9) FROM iq_dummy

The following statement returns the value FFFFFFFFFFFFFFF7:

SELECT BIGINTTOHEX (-9) FROM iq_dummy

Usage

The BIGINTTOHEX function accepts an integer expression that evaluates to BIGINT and returns the hexadecimal equivalent. Returned values are left appended with zeros up to a maximum of 16 digits. All types of unscaled integer data types are accepted as integer expressions.

Conversion is done automatically, if required. Constants are truncated, only if the fraction values are zero. A column cannot be truncated, if the column is declared with a positive scale value. If conversion fails, Sybase IQ returns an error unless the CONVERSION_ERROR option is OFF. In that case, the result is NULL.

Standards and compatibility

See also

“CONVERSION_ERROR option [TSQL]”

“HEXTOBIGINT function [Data type conversion]”

“HEXTOINT function [Data type conversion]”

“INTTOHEX function [Data type conversion]”