decode()

Converts blob to VARCHAR. Fails if blob is not valid UTF-8.

Arguments & returns

decode(blob)

Scalar
Overload link blob Returns
#01 BLOB VARCHAR

Example

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

Engine example · Run to view results.

More examples

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

Engine example · Run to view results.

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

Engine example · Run to view results.

In other engines

Apache Sparkdecode()

DECODE(x, 'utf-8')
In DuckDB
DECODE(x)

SQLGlot example ↗

Prestofrom_utf8()

FROM_UTF8(x)
In DuckDB
DECODE(x)

SQLGlot example ↗

Snowflakebase64_decode_string()

SELECT BASE64_DECODE_STRING('U25vd2ZsYWtl')
In DuckDB
SELECT DECODE(FROM_BASE64('U25vd2ZsYWtl'))

SQLGlot example ↗