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