Returns the number of records in a table.

Syntax

RECCOUNT([<alias>])

<alias>

The work area you want to check.

Description

RECCOUNT( ) retrieves a count of a table's records from the table header, which holds information about the table structure. In contrast, COUNT with no options yields a record count by actually counting the table's records using the table’s current filter, key constraints, the setting of SET DELETED and so on. RECCOUNT( ) includes all records, even those marked as deleted, and is always instantaneous; COUNT is not.

If no table is active in the specified work area, RECCOUNT( ) returns zero.

You can use RECSIZE( ) in combination with RECCOUNT( ) to determine the approximate size, in bytes, of a table.

OODML

In some cases, the Rowset object’s rowCount( ) method will return the same value.