Nbrecord
nbrecord
returns the number of lines in a database table.
Syntax
nbrecord(CLASS)
CLASS
is a class associated with an opened table.
Examples
# How many customers and items?
Local Integer CUST_COUNT, ITEM_COUNT
Local 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 code | Description |
---|---|
7 | The table is not opened. |