Consultor Eletrônico



Kbase P128206: SQL: How to CREATE and DROP a table index using the SQL-92 Data Definition Language?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/9/2009
Status: Verified

GOAL:

SQL: How to CREATE and DROP a table index using the SQL Data Definition Language?

GOAL:

How to add and delete a table indexes using the SQL Data Definition Language (DDL)?

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.1x
OpenEdge 10.x

FIX:

1. To add an index to a table, use the CREATE INDEX statement. The general Syntax for the CREATE INDEX statement is:
CREATE [ UNIQUE ] INDEX index_name
ON table_name
( { column_name [ ASC | DESC ] } [, ... ] )
[ AREA area_name ]
[ PRO_DESCRIPTION value | PRO_ACTIVE {?N?|?n?} ];
For example, the following SQL statement:
CREATE INDEX idx_City ON PUB.Customer (City ASC);
Adds the ascending index , idx_City to the Customer table definition.
2. To delete an index from a table definition, use the SQL DROP INDEX statement. The general Syntax for the DROP INDEX statement is:
DROP INDEX [ index_owner_name.]index_name
[ ON [ table_owner_name.]table_name ];
For example, the following SQL DDL statement:
DROP INDEX idx_City ON PUB.Customer;
Deletes the index idx_City for the Customer table definition.