DB_NAME Function [System]

Returns the database name.

Syntax

DB_NAME ( [ database-id ] )
Note: CIS functional compensation performance considerations apply.

Parameters

Parameters

Parameter

Description

database-id

The ID of the database. database-id must be a numeric expression

Returns

VARCHAR

Example

Returns the database name iqdemo, when executed against the demo database:

SELECT DB_NAME( 0 ) FROM iq_dummy

Usage

If no database-id is supplied, the name of the current database is returned.

Standards and Compatibility

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

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

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