Neoview ODBC Drivers Manual (R2.5)

Example of INFOSTATS
Suppose an application prepares a SELECT statement: SELECT * FROM T1. Use
SQLGetCursorName to find the statement name. In this example, the returned statement name
is SQL_CUR_3.
To get statistics for SELECT * FROM T1, the application must allocate another statment
handle and issue SQLExecDirect on INFOSTATS SQL_CUR_3. The statistics are returned as
a result set. Use SQLFetch to retrieve the result.
SQLPrepare:
In: StatementHandle - 0x003A1940, StatementText = "select * from tst1",
TextLength - 18
Return: SQL_SUCCESS=0
SQLGetCursorName:
SQLAllocHandle:
In: HandleType = SQL_HANDLE_STMT=3, InputHandle = 0x003A1720, OutputHandlePtr = 0x00158CF0
Return: SQL_SUCCESS=0
Out: *OutputHandlePtr = 0x003A2158
SQLExecDirect :
In: hstmt = 0x003A2158, szSqlStr = "infostats SQL_CUR_3", cbSqlStr = -3
Return: SQL_SUCCESS=0
Get Data All:
"QueryID", "CPUTime", "IOTime", "MsgTime", "IdleTime", "TotalTime"'
"Cardinality"
"MXID001000862212016119949296982_16_SQL_CUR_3", 0.0996850252442303,
0.1019600014042226, 0.0980000013441895, 0.0980000013441895,
0.1019600014042226, 129.0
1 row fetched from 7 columns
In this example, INFOSTATS is issued directly on the SQL statement. Again, use SQLFetch to
retrieve the result:
SQLExecDirect:
In: hstmt = 0x003B1968
szSqlStr = "infostats "select * from t1"", cbSqlStr = -3
Return: SQL_SUCCESS=0
Get Data All:
"QueryID", "CPUTime", "IOTime", "MsgTime", "IdleTime", "TotalTime"
"Cardinality"
"MXID115000897212014649972695973_60_STMT_INFOSTATS
", 0.0986710164301648, 0.1023000010183761, 129.0 0.0980000013441895,
0.0980000013441895, 0.1023000010183761, 129.0
1 row fetched from 7 columns.
Unsupported ODBC API Functions and Data Types
API Functions
This release of the HP Neoview ODBC drivers does not support the following ODBC 3.51 API
functions:
SQLBulkOperations
SQLFetchScroll - supported for SQL_FETCH_NEXT attribute only
SQLSetScrollOption
Data Types
NDCS does not support the following ODBC data types:
BIT
TINYINT and TINYINT UNSIGNED
BINARY
VARBINARY
LONG VARBINARY
44 HP Neoview ODBC Drivers Overview for UNIX