Skip to content

Converts a VARCHAR string to a binary value based on the specified binary format.

func.to_binary(<str>, <format>)
func.to_binary('Hello', 'utf8')
┌──────────┐
b'Hello'
└──────────┘
TO_BINARY(<str>, <format>)
SELECT TO_BINARY('Hello', 'utf8');
┌────────────┐
│ 48656C6C6F │
└────────────┘