Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

DATALENGTH function

Syntax

DATALENGTH( expr )

Description

Returns the number of bytes used to represent any expression. DATALENGTH is especially useful with VARCHAR, VARBINARY, LVARCHAR and LVARBINARY data types because these data types can store variable-length data.

Arguments

  • expr - An expression of any type.

Example

SELECT DATALENGTH(tbl) FROM systables WHERE tbl='systables';

DATALENGTH(TBL)

--

9

TOCIndex