COL_NAME Function [System]

Returns the column name.

Syntax

COL_NAMEtable-id, column-id [ , database-id ] )

Parameters

Parameters

Parameter

Description

table-id

The object ID of the table.

column-id

The column ID of the column.

database-id

The database ID.

Examples

The following statement returns the column name lname. The object ID of the Customers table is 100209, as returned by the OBJECT_ID function. The column ID is stored in the column_id column of the syscolumn system table. The database ID of the iqdemo database is 0, as returned by the DB_ID function.

SELECT COL_NAME( 100209, 3, 0 ) FROM iq_dummy

The following statement returns the column name city.

SELECT COL_NAME ( 100209, 5 )FROM iq_dummy

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Adaptive Server Enterprise function implemented for SAP Sybase IQ.

Related reference
DB_ID Function [System]
DB_NAME Function [System]
DB_PROPERTY Function [System]
NEXT_DATABASE Function [System]
OBJECT_ID Function [System]
OBJECT_NAME Function [System]