ASA SQL Reference
SQL Functions
Alphabetical list of functions
Returns the length in bytes of the underlying storage for the result of an expression.
DATALENGTH ( expression )
expression The expression is usually a column name. If the expression is a string constant, it must be enclosed in quotes.
The return values of DATALENGTH are as follows:
| Data type | DATALENGTH |
|---|---|
| SMALLINT | 2 |
| INTEGER | 4 |
| DOUBLE | 8 |
| CHAR | Length of the data |
| BINARY | Length of the data |
SQL/92 Vendor extension.
SQL/99 Vendor extension.
Sybase Compatible with Adaptive Server Enterprise.
The following statement returns the value 27, the longest string in the company_name column.
SELECT following MAX( DATALENGTH( company_name ) ) FROM customer