INTTOHEX function [Data type conversion]

Function

Returns the hexadecimal equivalent of a decimal integer.

Syntax

INTTOHEX ( integer-expression )

Parameters

integer-expression The integer to be converted to hexadecimal.

Examples

The following statement returns the value 0x000000000000009c:

SELECT INTTOHEX( 156 ) FROM iq_dummy

The following statement returns the value 0x0000000000000064:

SELECT INTTOHEX ( 100) FROM iq_dummy

Usage

The ‘0x’ or ‘0X’ prefix and leading zeroes are included in the result.

NoteThe INTTOHEX function in Sybase IQ returns a binary(8) value. Unlike Sybase IQ, Adaptive Server Anywhere returns a varchar(8). If conversion fails, Sybase IQ returns an error unless CONVERSION_ERROR is OFF. In that case the result is NULL.

Standards and compatibility

See also

“HEXTOINT function [Data type conversion]”