Nbrecord

nbrecord returns the number of lines in a database table.

Syntax

 nbrecord(CLASS)

Examples

 # How many customers and items?Local Integer CUST_COUNT, ITEM_COUNTLocal File BPCUSTOMER [BPC], ITMMASTER [ITM]CUST_COUNT=nbrecord([BPC])ITEM_COUNT=nbrecord([ITM])

Description

nbrecord returns the number of lines on a table opened by File or Trbegin.

It performs a Select count(*) From TABLE.

The type of result is Integer or Decimal.

Comment

No Where clause is used on the count, even if Where conditions have been given on the table declaration or in a Filter statement. If the count must be done on a selection, rowcount must be used.

Associated errors

Error codeDescription
7The table is not opened.

See also

File, Trbegin, rowcount.