Name: revDatabaseColumnCount

Type: function

Syntax: revDatabaseColumnCount(<recordSetID>)

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

Synonyms: revdb_columncount

Introduced: 1.1

OS: mac,windows,linux,ios,android

Platforms: desktop,server,web,mobile

Security: disk,network

Example:
revDatabaseColumnCount(12)

Example:
revDatabaseColumnCount(the savedResultsPointer of this card)

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

Returns: The <revDatabaseColumnCount> <function> returns either positive <integer> or the number -1.

Description:
Use the <revDatabaseColumnCount> <function> to find out how many <database field|database fields> you must deal with in a <record set (database cursor)(glossary)>.

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

>*Note:* 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 <revDatabaseColumnCount> will return a value of -1. This is currently applicable to Oracle databases and certain ODBC data sources.

>*Important:*  The <revDatabaseColumnCount> <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.

Changes:
The revDatabaseColumnCount synonym was added in version 2.0.

References: string (keyword), integer (keyword), Database library (library), Revolution custom library (library), revDatabaseColumnNames (function), revDatabaseColumnNumbered (function), database field (glossary), Standalone Application Settings (glossary), standalone application (glossary), record set (database cursor) (glossary), return (glossary), function (control_st)

Tags: database
