Rowcount

rowcount allows you to return the number of lines corresponding to a selection condition in a database table.

Syntax

 rowcount(CLASS)

Examples

 # How many customers and items are active ?Local Integer CUST_COUNT, ITEM_COUNTLocal File BPCUSTOMER [BPC] Where BPCSTA=2, ITMMASTER [ITM] Where ITMSTA=1CUST_COUNT=rowcount([BPC])ITEM_COUNT=rowcount([ITM])

Description

nbrecord returns the number of lines that corresponds to the filter defined by a Where clause on a table opened by File or Trbegin.

It performs a Select count(*) Where... From TABLE.

The type of result is Integer or Decimal.

Comment

If no Where clause has to be used on the count, nbrecord must be used.

Associated errors

Error codeDescription
7The table is not opened.

See also

File, Trbegin, nbrecord.