Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

SQL Reference

Functions

Syntax

Example

 

SQL Reference

Joins

Nested Queries

Set Operations

ON CURSOR | INSTANCE

WITH Options

Commands

Functions

 

$COLUMN_LENGTH | $COL_LEN

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) | $COLUMN_LENGTH(column)

(column)
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

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

Company: National Computer Systems
$COLUMN_LENGTH: 40
CHARACTER_LENGTH: 25

Top