length()

Scalar. Returns the number of bytes of a given binary value.

Syntax

length ( binary )

Parameters

binary

A binary value.

Usage

Returns the number of bytes that make up a given binary value. The function takes a binary value as its argument, and the function returns an integer. If the binary value is NULL, the function returns NULL.

Example

length (hex_binary ('0xaa1234')) returns 3.

length (hex_binary ('aa')) returns 1.