Only Dynamic Server supports this statement, which is an extension to the ANSI/ISO standard for SQL.
>>-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 |
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 statements: ALTER INDEX, CREATE INDEX, and DROP INDEX
For a discussion of SPL-routine reoptimization, see your IBM Informix Performance Guide.