Server_NumCols() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Retrieves the number of columns in the result set. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Server_NumCols( StatementNumber )

StatementNumber is an integer value that identifies information about an SQL statement.

Return Value

Integer

Description

The Server_NumCols() function returns the number of columns in the result set currently referenced by StatementNumber.

Example

Dim hdbc, hstmt As Integer
hdbc = Server_Connect("ODBC", "DLG=1")
hstmt = Server_Execute(hdbc, "Select Name, Addr from emp")
Print "Number of columns = " + Server_NumCols(hstmt)

See Also:

Server_ColumnInfo() function