<doc>
  <legacy_id>1976</legacy_id>
  <name>revDatabaseColumnCount</name>
  <type>function</type>
  <syntax>
    <example>revDatabaseColumnCount(<i>recordSetID</i>)</example>
  </syntax>
  <library>Database library</library>
  <objects>
  </objects>
  <synonyms>
    <synonym>revdb_columncount</synonym>
  </synonyms>
  <classification>
    <category>Database Operations</category>
    <category>Standalone Applications</category>
  </classification>
  <references>
    <function tag="revDatabaseColumnNumbered">revDatabaseColumnNumbered Function</function>
    <function tag="revDatabaseColumnNames">revDatabaseColumnNames Function</function>
  </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 <glossary tag="database field">database fields</glossary> in a <glossary tag="record set (database cursor)">record set (database cursor)</glossary>.</summary>
  <examples>
    <example>revDatabaseColumnCount(12)</example>
    <example>revDatabaseColumnCount(the savedResultsPointer of this card)</example>
  </examples>
  <description>
    <p>Use the <b>revDatabaseColumnCount</b> <control_st tag="function">function</control_st> to find out how many <glossary tag="database field">database fields</glossary> you must deal with in a <glossary tag="record set (database cursor)">record set (database cursor)</glossary>.</p><p/><p><b>Parameters:</b></p><p>The <i>recordSetID</i> is the number returned by the <function tag="revQueryDatabase">revQueryDatabase</function> function when the <glossary tag="record set (database cursor)">record set</glossary> was created.</p><p/><p><b>Value:</b></p><p>The <b>revDatabaseColumnCount</b> <control_st tag="function">function</control_st> returns either positive <keyword tag="integer">integer</keyword> or the number -1.</p><p/><p><b>Comments:</b></p><p>If the operation is not successful, the <b>revDatabaseColumnCount</b> <control_st tag="function">function</control_st> returns an error message that begins with the <keyword tag="string">string</keyword> "revdberr".</p><p/><p><b>Note:</b> Some database systems will not give the columm count until all the records in a record set have been fetched. This is for efficiency reasons. When the column count is not available the <b>revDatabaseColumnCount</b> will return a value of -1. This is currently applicable to Oracle databases and certain ODBC data sources.</p><p/><p><img src="202653"/> <b>Important!</b> The <b>revDatabaseColumnCount</b> <control_st tag="function">function</control_st> is part of the <glossary tag="Database library">Database library</glossary>. To ensure that the <control_st tag="function">function</control_st> 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.</p><p/><p><b>Changes:</b></p><p>The <b>revDatabaseColumnCount</b> synonym was added in version 2.0.</p>
  </description>
</doc>