You use the SQL Select statement to specify the columns and records to be read. Btrieve Select statements support all the Select statement clauses described in
Chapter 10 “SQL for Flat-File Drivers” in the
DataDirect Connect Series for ODBC Reference. This section describes the information that is specific to Btrieve.
Each Btrieve record contains a special column named Rowid. This field contains a unique number that indicates the record’s sequence in the database. You can use Rowid in Where and Select clauses.
Rowid is particularly useful when you are updating records. You can retrieve the Rowid of the records in the database along with the other field values. For example:
Then, you can use the Rowid of the record that you want to update to ensure that you are updating the correct record and no other. For example:
Select statements that use the Rowid pseudo-column in the Where clause achieve maximum performance only for exact equality matches. If you use range scans instead of exact equality matches, a full table scan is performed. For example: