<doc>
  <legacy_id>1094</legacy_id>
  <name>revNumberOfRecords</name>
  <type>function</type>
  <syntax>
    <example>revNumberOfRecords(<i>recordSetID</i>)</example>
  </syntax>
  <library>Database library</library>
  <objects>
  </objects>
  <synonyms>
    <synonym>revdb_recordcount</synonym>
  </synonyms>
  <classification>
    <category>Database Operations</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <command tag="revMoveToNextRecord">revMoveToNextRecord Command</command>
  </references>
  <history>
    <introduced version="1.1">Added.</introduced>
    <changed version="2.0"></changed>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
    <disk access="???"/>
    <network/>
  </security>
  <summary><glossary tag="return">Returns</glossary> the number of records in a <glossary tag="record set (database cursor)">record set (database cursor)</glossary>.</summary>
  <examples>
    <example>revNumberOfRecords(westCoastCustomers)</example>
    <example>get revNumberOfRecords(15) <code><i>-- number of records in record set 15</i></code></example>
    <example>repeat for revNumberOfRecords(pastDueCustomers) times</example>
  </examples>
  <description>
    <p>Use the <b>revNumberOfRecords</b> <href tag="">function</href> to find out how many <glossary tag="record">records</glossary> matched a <glossary tag="SQL query">query</glossary>.</p>
<p>&nbsp;</p>
<p><b>Parameters:</b></p>
<p>The <i>recordSetID</i> is the number <glossary tag="return">returned</glossary> by the <function tag="revQueryDatabase">revQueryDatabase</function> function when the <glossary tag="record set (database cursor)">record set</glossary> was created.</p>
<p>&nbsp;</p>
<p><b>Value:</b></p>
<p>The <b>revNumberOfRecords</b> <href tag="">function</href> returns either a non-negative integer or -1 if the number of records could not be determined.</p>
<p>&nbsp;</p>
<p><b>Comments:</b></p>
<p>If the query is not successful, the <b>revNumberOfRecords</b> <href tag="">function</href> returns an error message that begins with the <keyword tag="string">string</keyword> "revdberr".</p>
<p>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 <b>revNumberOfRecords</b> function will return -1.</p>
<p>&nbsp;</p>
<p><code><b>Important!</b><code> The <b>revNumberOfRecords</b><href tag="">function</href> is part of the <glossary tag="Database library">Database library</glossary>. To ensure that the <href tag="">function</href> works in a <glossary tag="standalone application">standalone application</glossary>, you must include this <glossary tag="LiveCode custom library">custom library</glossary> when you create your <glossary tag="standalone application">standalone</glossary>. In the Inclusions section of the General screen of the <glossary tag="Standalone Application Settings">Standalone Application Settings</glossary> window, make sure the "Database Support" checkbox is checked and the database drivers you are using are selected in the list of database drivers.</code></code></p>
<p>&nbsp;</p>
<p><b>Changes:</b></p>
<p>The <b>revNumberOfRecords</b> synonym was added in version 2.0.</p>
  </description>
</doc>