Arranging key fields in ascending or descending sequence
You can arrange key fields in either ascending or descending sequence. When you describe a key field, the default is ascending sequence. However, you can use the Descend (DESCEND) DDS keyword to specify that you want to arrange a key field in descending sequence.
Consider the following records.
If the Empnbr field is the key field, the two possibilities for organizing these records are:
Record Empnbr Clsnbr Clsnam Cpdate 1 56218 412 Welding I 032188 2 41322 412 Welding I 011388 3 64002 412 Welding I 011388 4 23318 412 Welding I 032188 5 41321 412 Welding I 051888 6 62213 412 Welding I 032188
- In ascending sequence, where the order of the records in the access path is shown in the following table.
Record Empnbr Clsnbr Clsnam Cpdate 4 23318 412 Welding I 032188 5 41321 412 Welding I 051888 2 41322 412 Welding I 011388 1 56218 412 Welding I 032188 6 62213 412 Welding I 032188 3 64002 412 Welding I 011388
- In descending sequence, where the order of the records in the access path is shown in the following table.
Record Empnbr Clsnbr Clsnam Cpdate 3 64002 412 Welding I 011388 6 62213 412 Welding I 032188 1 56218 412 Welding I 032188 2 41322 412 Welding I 011388 5 41321 412 Welding I 051888 4 23318 412 Welding I 032188
Parent topic:
Using keyed sequence access paths for database files