(Contents)(Previous)(Next)

Direct Access Using a Key

A table with key columns can, of course, be processed with the usual SELECT statement.

SELECT zip, name, state

FROM city

ORDER BY state

Key columns can also be used for direct access to a single row. The key is specified in the WHERE condition by the additional keyword KEY.

SELECT DIRECT name FROM city KEY zip = 10580

The single row access is very efficient. It does not need an index.

A single row access, however, is not only performed for a SELECT DIRECT specification.

If SELECT...INTO is used in a program and if it is ensured at the same time that the WHERE clause contains equality conditions for all key columns, the efficient single row access is performed in this case, too.

For more detailed information, refer to the Reference manual or to the Precompiler manuals.


(Contents)(Previous)(Next)