Neoview ODBC Drivers Manual (R2.2 SP1)
Table Of Contents
- HP Neoview ODBC Drivers Manual
- Table of Contents
- About This Document
- 1 HP Neoview ODBC Driver Overview for Windows
- 2 HP Neoview ODBC Drivers Overview for Linux, HP-UX, IBM AIX®, and Sun Solaris
- 3 Installing the HP Neoview ODBC Drivers
- Installing ODBC Client Software
- Avoiding Driver-Platform Version Incompatibility
- Installing the HP Neoview ODBC Driver for Windows
- Reinstalling the HP Neoview ODBC Driver for Windows
- Uninstalling the HP Neoview ODBC Driver for Windows
- Setting Up the Client Environment
- Troubleshooting
- Getting the Version of the Driver
- ODBC API Reference
- Installing or Reinstalling HP Neoview ODBC Drivers for Linux, HP-UX, IBM AIX®, and Sun Solaris
- Setting Up the Client Environment
- Running the Sample Program
- Troubleshooting
- Debugging
- Getting the Version of the Driver
- ODBC API Reference
- 4 Configuring Client Data Sources
- 5 HP Neoview ODBC Drivers Conformance
- 6 HP Neoview ODBC Drivers Messages
- Index
• IdleTime (SQL_DOUBLE): An estimate of the maximum number of seconds to wait for an
event to happen for this query. The estimate includes the amount of time to open a table or
start an ESP process.
• TotalTime (SQL_DOUBLE): Estimated cost associated to execute the query.
• Cardinality (SQL_DOUBLE): Estimated number of rows that will be returned.
INFOSTATS {stmt-name | cursor-name | sql-stmt }
A pass-through command that collect statistics for a prepared statement.
stmt-name
is the name of a prepared statement. If a case-sensitive statement name is used, you must
enclose it in either single quotes or double quotes.
cursor-name
is an SQL identifier. The name is unique within the containing module or compilation unit.
The maximum length of a cursor name is 128 characters. If a case-sensitive cursor name is
used, you must enclose it in either single quotes or double quotes.
sql-stmt
is any valid SQL query surrounded by either single quotes or double-quotes.
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.
INFOSTATS Command 27