Name: revNumberOfRecords

Type: function

Syntax: revNumberOfRecords(<recordSetID>)

Summary: <return|Returns> the number of records in a <record set (database cursor)(glossary)>.

Synonyms: revdb_recordcount

Introduced: 1.1

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Security: disk,network

Example:
revNumberOfRecords(westCoastCustomers)

Example:
get revNumberOfRecords(15) -- number of records in record set 15

Example:
repeat for revNumberOfRecords(pastDueCustomers) times

Parameters:
recordSetID: The number returned by the revQueryDatabase function when the record set was created.

Returns: The <revNumberOfRecords> function returns either a non-negative integer or -1 if the number of records could not be determined.

Description:
Use the <revNumberOfRecords> function to find out how many <record|records> matched a <SQL query|query>.

&nbsp;

If the query is not successful, the <revNumberOfRecords> function returns an error message that begins with the <string> "revdberr".

Some database types do not support returning the number of records in a result set. One example of this is ODBC data sources with forward-only cursors. If the database does not support this feature, the <revNumberOfRecords> function will return -1.

&nbsp;

>*Important:* The <revNumberOfRecords> function is part of the <Database library>. To ensure that the function works in a <standalone application>, you must include this <Revolution custom library|custom library> when you create your <standalone application|standalone>. In the Inclusions section of the General screen of the <Standalone Application Settings> window, make sure the "Database Support" checkbox is checked and the database drivers you are using are selected in the list of database drivers.

&nbsp;

References: string (keyword), revMoveToNextRecord (command), Standalone Application Settings (glossary), record (glossary), standalone application (glossary), record set (database cursor) (glossary), return (glossary), SQL query (glossary), Database library (library), Revolution custom library (library)

Tags: database
