Next: , Previous: Indexed Sequential Access Methods, Up: Table Operations


6.1.2.5 Sequential Index Operations

The following procedures are individually optional depending on the base-table implememtation. If an operation is not supported, then calling the table with that operation symbol will return false.

— Operation on relational-table: for-each-row-in-order

Returns a procedure of arguments proc match-key1 ... which calls proc with each row in this table in the (implementation-dependent) natural, repeatable ordering for rows. The optional match-key1 ... arguments restrict actions to a subset of the table. For details see See Match-Keys.

— Operation on relational-table: isam-next

Returns a procedure of arguments key1 key2 ... which returns the key-list identifying the lowest record higher than key1 key2 ... which is stored in the relational-table; or false if no higher record is present.

— Operation on relational-table: isam-next column-name

The symbol column-name names a key field. In the list returned by isam-next, that field, or a field to its left, will be changed. This allows one to skip over less significant key fields.

— Operation on relational-table: isam-prev

Returns a procedure of arguments key1 key2 ... which returns the key-list identifying the highest record less than key1 key2 ... which is stored in the relational-table; or false if no lower record is present.

— Operation on relational-table: isam-prev column-name

The symbol column-name names a key field. In the list returned by isam-next, that field, or a field to its left, will be changed. This allows one to skip over less significant key fields.

For example, if a table has key fields:

     (col1 col2)
     (9 5)
     (9 6)
     (9 7)
     (9 8)
     (12 5)
     (12 6)
     (12 7)

Then:

     ((table 'isam-next)       '(9 5))       ⇒ (9 6)
     ((table 'isam-next 'col2) '(9 5))       ⇒ (9 6)
     ((table 'isam-next 'col1) '(9 5))       ⇒ (12 5)
     ((table 'isam-prev)       '(12 7))      ⇒ (12 6)
     ((table 'isam-prev 'col2) '(12 7))      ⇒ (12 6)
     ((table 'isam-prev 'col1) '(12 7))      ⇒ (9 8)