This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
dev:sql:functions:character_length:home [2010/07/08 17:05] els removed |
— (current) | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{page>:top_add&nofooter&noeditbtn}} | ||
| - | <html><div align="center"><span style="color:red">DRAFT</span></div></html> | ||
| - | ====== Omnidex SQL Function: CHARACTER_LENGTH ====== | ||
| - | {{page>:sql_bar&nofooter&noeditbtn}} | ||
| - | ===== Description ===== | ||
| - | The CHARACTER_LENGTH and CHAR_LENGTH functions return the number of characters in a string. The number returned is a 4-byte integer. | ||
| - | CHARACTER_LENGTH and CHAR_LENGTH should not be confused with $COL_LEN and $COLUMN_LENGTH which return the length of the column as it is defined in the environment catalog. | ||
| - | |||
| - | CHARACTER_LENGTH and CHAR_LENGTH are the same function. Both are supported for flexibility. | ||
| - | ===== Syntax ===== | ||
| - | CHAR[ACTER]_LENGTH ( [column_spec | "string"] ) | ||
| - | |||
| - | == column_spec == | ||
| - | Required. Any column contained in the FROM clause. This can be prefixed with a table and database name. | ||
| - | |||
| - | == "string" == | ||
| - | Required. Any string. This can be a literal string or a nested set of functions and string operations that return a string datatype. | ||
| - | |||
| - | ===== Examples ===== | ||
| - | ==== Example 1: Column ==== | ||
| - | <code SQL> | ||
| - | select company, city, | ||
| - | char_length (city) | ||
| - | from customers | ||
| - | where state = 'co'; | ||
| - | </code> | ||
| - | ==== Example 2: Quoted String ==== | ||
| - | <code SQL> | ||
| - | select company, contact, | ||
| - | character_length ("Denver") | ||
| - | from customers | ||
| - | where state = 'co'; | ||
| - | </code> | ||
| - | |||
| - | {{page>:bottom_add&nofooter&noeditbtn}} | ||