Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements >

RENAME INDEX

Use the RENAME INDEX statement to change the name of an existing index.

Only Dynamic Server supports this statement, which is an extension to the ANSI/ISO standard for SQL.

Syntax

Read syntax diagramSkip visual syntax diagram>>-RENAME INDEX--+--------+--old_index--TO--new_index----------><
                 '-owner.-'
 

Element Description Restrictions Syntax
new_index New name that you declare here for the index Name must be unique to the database (or to the session, if old_index is on a temporary table) Identifier, p. Identifier
old_index Index name that new_index replaces Must exist, but it cannot be any of the following:
-- An index on a system catalog table
-- A system-generated constraint index
-- A Virtual-Index Interface (VII)
Identifier, p. Identifier
owner Owner of index Must be the owner of old_index Owner Name, p. Owner Name

Usage

You can rename an index if you are the owner of the index or have the DBA privilege on the database.

When you rename an index, the database server changes the index name in the sysindexes, sysconstraints, sysobjstate, and sysfragments system catalog tables. (But for an index on a temporary table, no system catalog tables are updated.)

Indexes on system catalog tables cannot be renamed. If you want to change the name of a system-generated index that implements a constraint, use the ALTER TABLE ... DROP CONSTRAINT statement to drop the constraint, and then use the ALTER TABLE ... ADD CONSTRAINT statement to define a new constraint that has the same definition as the constraint that you dropped, but for which you declare the new name.

SPL routines that use the renamed index are reoptimized on their next use after the index is renamed.

Related Information

Related statements: ALTER INDEX, CREATE INDEX, and DROP INDEX

For a discussion of SPL-routine reoptimization, see your IBM Informix Performance Guide.

Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]