revNumberOfRecords

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
revNumberOfRecords(<recordSetID>)
Synonymsrevdb_recordcount
Associationsdatabase library
Summary

Returns the number of records in a record set (glossary).

Introduced1.1
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
recordSetID

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

Example
revNumberOfRecords(westCoastCustomers)
get revNumberOfRecords(15) -- number of records in record set 15
repeat for revNumberOfRecords(pastDueCustomers) times
Values
NameTypeDescription
return

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

RelatedKeyword: string
Command: revMoveToNextRecord
Glossary: Standalone Application Settings, record, standalone application, record set, return, SQL query, LiveCode custom library, function
Library: Database library
Securitydisk, network
Description

Use the revNumberOfRecords function to find out how many records matched a 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 custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Database" library checkbox is checked.

Tagsdatabase