Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge HMI

DBCursorColumnCount

  • Last UpdatedAug 07, 2026
  • 2 minute read

DBCursorColumnCount gets the total number of columns in a SQL result set.

Function

Group

Execution

String Exp.

Windows

Windows Embedded

IoT View

Thin Clients

Mobile Access

DBCursorColumnCount

Database/ERP

Synchronous

Yes

Supported

Supported

Not supported

Supported

Supported

Syntax

DBCursorColumnCount(numCur, "optStrErrorTag")

numCur

The cursor handle for the result set, which was returned by DBCursorOpen or DBCursorOpenSQL.

optStrErrorTag

The name of a project tag that will receive detailed error messages, if errors occur during project run time.

Note: If this parameter is enclosed in quotes, the string literal will be used. Otherwise, the value of the tag/expression will be used.

This parameter is optional.

Return value

In case of success, this function returns the number of columns in the SQL result set.

In the case of error, this function returns one of the following possible values:

Value

Error Message

-1

DBERROR_DATABASE_ERROR

-2

DBERROR_CONNECTION_OPEN_ERROR

-3

DBERROR_CURSOREMPTY_FAILURE

-4

DBERROR_CURSORMOVE_FAILURE

-5

DBERROR_CURSORFETCH_FAILURE

-6

DBERROR_CURSORNOTOPEN_FAILURE

-7

DBERROR_CURSOR_EOF

-8

DBERROR_CURSOR_BOF

-9

DBERROR_INVALID_COMMAND

-10

DBERROR_INVALID_CURSOR

-100

DBERROR_NOT_ENOUGH_PARAMETERS

-101

DBERROR_INVALID_PARAMETER_DB

-102

DBERROR_INVALID_PARAMETER_TABLE

-103

DBERROR_INVALID_PARAMETER_COLLIST

-104

DBERROR_INVALID_PARAMETER_CONDITION

-105

DBERROR_INVALID_PARAMETER_ORDER

-106

DBERROR_INVALID_PARAMETER_SQL

-107

DBERROR_INVALID_PARAMETER_CURSOR

-108

DBERROR_INVALID_PARAMETER_VALUELIST

-109

DBERROR_INVALID_PARAMETER_TAGLIST

-110

DBERROR_INVALID_PARAMETER_ERRORTAG

-111

DBERROR_INVALID_PARAMETER_MAXROWS

-112

DBERROR_INVALID_PARAMETER_SQL_QUERY

-113

DBERROR_INVALID_PARAMETER_ROW

-114

DBERROR_INVALID_PARAMETER_COLUMNNUMBER

-115

DBERROR_INVALID_PARAMETER_COLUMNINFO

-199

DBERROR_TOO_MANY_PARAMETERS

-200

DBERROR_TCP_COMM_FAILURE

-201

DBERROR_EXCEEDED_OPEN_BUFFER

-202

DBERROR_EXECUTING_ONLY_CLEANUP_COMMANDS

Notes

See also DBCursorRowCount.

Database/ERP functions emulate Structured Query Language (SQL) database operations. Before you use these functions, familiarize yourself with how SQL statements are formed and executed.

You can use the Database Gateway (StADOSvr) to directly monitor database connections for leaks and errors. For more information, see Database Interface.

Examples

Get the number of columns in the SQL result set that is represented by the cursor handle stored in nCursor:

DBCursorColumnCount(nCursor)

In This Topic