Server_GetODBCHStmt() 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

Return the ODBC statement handle associated with the MapBasic Server... statements. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Server_GetODBCHStmt( StatementNumber )

StatementNumber is the integer returned by the Server_Execute() function that identifies the result set of the SQL statement executed.

Description

This function returns the ODBC statement handle associated with the MapBasic Server... statements. This enables you to call any ODBC function to extend the functionality available through the MapBasic Server... statements.

Example

' Find the Number of rows affected by an Update
Dim rc, outlen, hdbc, hstmt, odbchstmt AS INTEGER
Dim RowsUpdated AS INTEGER
' Find the Number of rows affected by an Update
DECLARE FUNCTION SQLRowCount LIB "ODBC32.DLL" (BYVAL odbchstmt AS INTEGER, 
rowcnt AS INTEGER) AS INTEGER
hdbc = Server_Connect("ODBC", "DLG=1")
hstmt = Server_Execute(hdbc, "UPDATE TIML.CUSTOMER SET STATE='NY' WHERE 
STATE='NY'")
odbchstmt = Server_GetodbcHStmt(hstmt)
rc = SQLRowCount(odbchstmt, RowsUpdated)
Note "Updated " + RowsUpdated + " New customers to Tier 1"

See Also:

Server_GetODBCHConn() function