4D v14.3About Record Numbers |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
About Record Numbers
About Record Numbers
There are three numbers associated with a record:
The record number is the absolute/physical record number for a record. A record number is automatically assigned to each new record and remains constant for the record until the record is deleted. Record numbers start at zero. They are not unique because record numbers of deleted records are reused for new records. They also change when the database is compacted or repaired. The selected record number is the position of the record in the current selection, and so depends on the current selection. If the selection is changed or sorted, the selected record number will probably change. Numbering for the selected record number starts at one (1). The sequence number is a unique nonrepeating number that may be assigned to a field of a record (via the Autoincrement property, the SQL AUTO_INCREMENT attribute or the Sequence number command). It is not automatically stored with each record. It starts by default at 1 and is incremented for each new record that is created. Unlike record numbers, a sequence number is not reused when a record is deleted or when a database is compacted or repaired. Sequence numbers provide a way to have unique ID numbers for records. If a sequence number is incremented during a transaction, the number is not decremented if the transaction is canceled. Note: 4D does not carry out any check when you modify the automatic number internal counter of a table using the SET DATABASE PARAMETER command. If you decrement this counter, the new records created may have numbers that have already been assigned. The following tables illustrate the numbers that are associated with records. Each line in the table represents information about a record. The order of the lines is the order in which records would be displayed in an output form.
The first table shows the records after they are entered.
Note: The records remain in the default order after a command changes the current selection without reordering it; for example, after the Show All menu command is chosen in the Design environment, or after the ALL RECORDS command is executed. The next table shows the same records sorted by name.
The following table shows the records after Sam is deleted.
The next table shows the records after a new record has been added for Liz.
The following table shows the records after the selection was reduced to three records and then sorted.
|
PROPERTIES
Product: 4D SEE ALSO
Record number ARTICLE USAGE
4D Language Reference ( 4D v12.4) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||