hex()

Converts blob to VARCHAR using hexadecimal encoding.

Arguments & returns

7 overloads

hex(blob)

Scalar
Overload link blob Returns
#01 BLOB VARCHAR

hex(string)

Scalar

Converts the string to hexadecimal representation.

Overload link string Returns
#02 VARCHAR VARCHAR

hex(value)

Scalar

Converts the value to hexadecimal representation.

Overload link value Returns
#03 BIGINT VARCHAR
#04 HUGEINT VARCHAR
#05 UBIGINT VARCHAR
#06 UHUGEINT VARCHAR
#07 VARINT VARCHAR

Example

2 more ↓
hex example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

More examples

hex example 2
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

hex example 3
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

In other engines

BigQuery

UPPER(TO_HEX(x))
In DuckDB
HEX(x)

SQLGlot example ↗