Application icon

Query Database Keys

Many query database statements use a key field to uniquely identify a row in a database. The key type is set when a database is opened by the Open Database for Querying statement.

When a specified key type is not keyless, symbolic names representing values in the key field are used as keys. The keys have leading and trailing spaces removed when a key lookup is performed. Note that the keys can optionally be treated as case and diacritic insensitive.

When a database is opened as keyless, absolute row numbers have to be used as keys. The format is:

# index

where index is a row number. The index should be an integer in the range of 0 through Query Database-Row Count minus 1. Query Database-Row Count is a named variable initialized when the database was opened and is maintained by query database statements which modify the number of rows.

Absolute row numbers can also be used with databases which are not opened as keyless. However, if a symbolic key value starts with a #, you will have to include a space before the key otherwise it will be assumed to be an absolute key. When passing a key to a non keyless database, a test is made for a leading #, prior to trimming the key value. As an example, a key of #text passed to a non keyless database, will fail as text is not a valid index. However {space}#text will be correctly matched.