BIGINTTOHEX Function [Data Type Conversion]

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

Syntax

BIGINTTOHEXinteger-expression )

Parameters

Parameter

Description

integer-expression

The integer to be converted to hexadecimal.

Examples

Returns the value 0000000000000009:

SELECT BIGINTTOHEX(9) FROM iq_dummy
Returns the value FFFFFFFFFFFFFFF7:
SELECT BIGINTTOHEX (-9) FROM iq_dummy

Usage

BIGINTTOHEX 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

  • SQL—Transact-SQL extension to ISO/ANSI SQL grammar.

  • Sybase—Compatible with Adaptive Server Enterprise.

Related reference
HEXTOBIGINT Function [Data Type Conversion]
HEXTOINT Function [Data Type Conversion]
INTTOHEX Function [Data Type Conversion]