revDatabaseColumnCount

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
revDatabaseColumnCount(<recordSetID>)
Synonymsrevdb_columncount
Associationsdatabase library
Summary

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

Introduced1.1
Changes

The revDatabaseColumnCount synonym was added in version 2.0.

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
revDatabaseColumnCount(12)
revDatabaseColumnCount(the savedResultsPointer of this card)
Values
NameTypeDescription
return

The revDatabaseColumnCount function returns either positive integer or the number -1.

RelatedKeyword: string, integer
Control Structure: function
Function: revDatabaseColumnNames, revDatabaseColumnNumbered
Library: Database library
Glossary: LiveCode custom library, database field, Standalone Application Settings, standalone application, record set, return
Securitydisk, network
Description

Use the revDatabaseColumnCount function to find out how many database fields you must deal with in a record set (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 custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure both the "Database" library checkbox and those of the database drivers you are using are checked.

Tagsdatabase