Progress
Programming
Handbook
Defining Indexes for Temporary Tables
You can define indexes explicitly for temporary tables or you can inherit indexes from existing database tables. When you define a temporary table to be LIKE a database table, the temporary table inherits index layouts from the LIKE table according to these rules:
- If you do not specify any index information, the temporary table inherits all the index layouts defined for the LIKE table.
- If you specify one or more USE INDEX options, the temporary table inherits only the explicitly named index layouts. If one of these indexes is the primary index of the LIKE table, it becomes the primary index of the temporary table, unless you explicitly specify AS PRIMARY for another index.
- If you specify one or more INDEX options, the temporary table also inherits index layouts named by a USE INDEX option. If the new index is specified as PRIMARY, it becomes the primary index of the temporary table.
- If you specify any index information, then no more than one primary index can be specified. If you do not specify a primary index, then the first index specified is treated as the primary index.
- If you do not specify any index information, Progress creates a default primary index which sorts records in the order they are entered.
The following is a summary of the rules that determine the primary index of a temporary table.
- If you specify AS PRIMARY or IS PRIMARY for an index, then that is the primary index.
- If you do not specify AS PRIMARY or IS PRIMARY, but you inherit the primary index from a database table, that index is the primary index.
- If neither Rule 1 nor Rule 2 applies, then the first index you specify, if any, is the primary index, unless it is a word index, in which case it can’t be primary.
- If you have not specified any index information, then Progress creates a default primary index that sorts the records in entry order.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |