Name: revNumberOfRecords

Synonyms: revdb_recordcount

Type: function

Syntax: revNumberOfRecords(<recordSetID>)

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

Associations: database library

Introduced: 1.1

OS: mac, windows, linux, ios, android

Platforms: desktop, server, 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>.

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.

>*Important:*  The <revGetDatabaseDriverPath> <function> is part of the 
> <Database library>. To ensure that the <function> works in a 
> <standalone application>, you must include this 
> <LiveCode custom library|custom library> when you create your 
> <standalone application|standalone>. In the Inclusions pane of the 
> <Standalone Application Settings> window, make sure the "Database" 
> library checkbox is checked.

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

Tags: database

