Returns the length, in bytes, of the underlying storage for the result of an expression.
DATALENGTH( expression )
expression Usually a column name. If expression is a string constant, you must enclose it in quotes.
UNSIGNED INT
The return values of the DATALENGTH function are as follows:
Data type | DATALENGTH |
---|---|
SMALLINT | 2 |
INTEGER | 4 |
DOUBLE | 8 |
CHAR | Length of the data |
BINARY | Length of the data |
This function supports NCHAR inputs and outputs.
SQL/2003 Vendor extension.
The following statement returns the length of the longest string in the CompanyName column.
SELECT MAX( DATALENGTH( CompanyName ) ) FROM Customers; |
The following statement returns the length of the string '8sdofinsv8s7a7s7gehe4h':
SELECT DATALENGTH( '8sdofinsv8s7a7s7gehe4h' ); |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |