Tech Tip: How to access "record numbers" in a SQL query?
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: January 6, 2012
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
To access "record numbers" in a SQL query, the __ROW_ID virtual field can be used. For example:
WHERE __ROW_ID = 5
Keep in mind that this behaves nothing like DB4D code. There is no "current record" in SQL, for example, so no record pointer is being moved like would happen with GOTO RECORD. Also the virtual fields are mainly for 4D internal use and are thus subject to change in implementation. It is preferable to use the primary key to locate the record via SQL.