DRAFT

Omnidex SQL Function: CASE

Description

The $COL_LEN and $COLUMN_LENGTH functions return the defined length of a column. The return data type is a 4-byte INTEGER. Both functions are identical.

These functions differ from the CHAR_LENGTH and CHARACTER_LENGTH functions:

$COL_LEN and $COLUMN_LENGTH return the length defined for the column in the Omnidex Environment Catalog. CHAR_LENGTH and CHARACTER_LENGTH return the actual length of the data contained in the column for that record.

The return data type is a 4 byte integer.

Syntax

$COL_LEN( <column_spec | 'string' > ) 

<column_spec | 'string' > Required. An unambiguous column name. Resolve ambiguities by qualifying the column name with the table name and database name if necessary.

$COL_LEN(tablename.columnname)
$COLUMN_LENGTH(databasename.tablename.columnname)

If this function is used in a SQL SELECT, INSERT, or UPDATE statement, then the column parameter must be from one of the tables referenced in the statement. If this function is used in a COLUMN statement within an environment file, then column must be the column being declared.

Example

Example 1

select company, 
$col_len(company),
char_length(company) 
from customers 
where company='national computer'

Company: National Computer Systems
$COLUMN_LENGTH: 40
CHARACTER_LENGTH: 25
 
Back to top
dev/sql/functions/col_length.txt ยท Last modified: 2012/10/26 14:28 (external edit)