Menu
Amazon Redshift
Database Developer Guide (API Version 2012-12-01)

TO_HEX Function

The TO_HEX function converts a number to its equivalent hexadecimal value.

Syntax

Copy
TO_HEX(string)

Arguments

string

The input parameter is a number to convert to its hexadecimal value.

Return Type

The TO_HEX function returns a hexadecimal value.

Examples

The following example shows the conversion of a number to its hexadecimal value:

Copy
select to_hex(2147676847); to_hex ---------- 8002f2af (1 row)