index_name

Description

Returns an index name, when you provide the index ID, the database ID, and the object on which the index is defined.

Syntax

index_name(dbid, objid, indid)

Parameters

dbid

is the ID of the database on which the index is defined.

objid

is the ID of the table (in the specified database) on which the index is defined.

indid

is the ID of the index for which you want a name.

Examples

Example 1

This example illustrates the normal usage of this function.

select index_name(db_id("testdb"),
    object_id("testdb...tab_apl"),1)
------------

Example 2

This example illustrates the output if the database ID is NULL and you use the current database ID.

select index_name(NULL,object_id("testdb..tab_apl"),1)
--------------------------

Example 3

This example displays the table name if the index ID is 0, and the database ID and object ID are valid.

select index_name(db_id("testdb"),
    object_id("testdb..tab_apl"),1)
-----------------------------

Usage

Permissions

Any user can execute this function.

See also

db_id, object_id