This shows you the differences between two versions of the page.
dev:sql:functions:data_length [2010/07/28 02:46] els |
dev:sql:functions:data_length [2016/06/28 22:38] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | {{page>:top_add&nofooter&noeditbtn}} | ||
- | {{page>:sql_bar&nofooter&noeditbtn}} | ||
- | |||
- | ====== Omnidex SQL Function: $DATA_LENGTH ====== | ||
- | ===== Description ===== | ||
- | The $DATA_LENGTH function returns the number of characters in a column, plus a terminating null for C STRING datatypes. The $DATA_LENGTH function does not trim trailing spaces, unlike the CHAR_LENGTH function. | ||
- | |||
- | $DATA_LENGTH should not be confused with CHARACTER_LENGTH and $COLUMN_LENGTH. CHARACTER_LENGTH returns the number of characters in a string, trimmed of trailing spaces. $COLUMN_LENGTH returns the length of the column as declared in the table. | ||
- | |||
- | This function returns an INTEGER datatype. | ||
- | |||
- | ===== Syntax ===== | ||
- | $DATA_LENGTH ( column ) | ||
- | |||
- | == column == | ||
- | |||
- | Required. The name of a column, qualified by the table and database as needed. | ||
- | |||
- | ===== Examples ===== | ||
- | ==== Example 1: Column ==== | ||
- | <code> | ||
- | > select state, description, $data_length(description) len from states; | ||
- | |||
- | ST DESCRIPTION LEN | ||
- | -- ------------------------------- ----------- | ||
- | AK Alaska 7 | ||
- | AL Alabama 8 | ||
- | AR Arkansas 9 | ||
- | AZ Arizona 8 | ||
- | CA California 11 | ||
- | CO Colorado 9 | ||
- | CT Connecticut 12 | ||
- | </code> | ||
- | |||
- | ====== Additional Resources ====== | ||
- | |||
- | See also: | ||
- | {{page>dev:sql:functions:see_also_utility&nofooter&noeditbtn&noheader}} | ||
- | |||
- | {{page>:bottom_add&nofooter&noeditbtn}} |