Example Of Explain Statement Using Odbc - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

Example of EXPLAIN Statement Using ODBC

Suppose an application prepares a SELECT statement: "SELECT * FROM
ODBC_PERSNL.EMPLOYEE". Use SQLGetCursorName to find the statement name. In this
example, the returned statement name is "SQL_CUR_21".
To get the plan for "SELECT * FROM ODBC_PERSNL.EMPLOYEE", the application must allocate
another statement handle and issue SQLExecDirect on "EXPLAIN options 'f' SQL_CUR_21".
The plan is returned as a result-set. Use SQLFetch to retrieve the result.
SQLPrepare: StatementText = " SELECT * FROM ODBC_PERSNL.EMPLOYEE;"
SQLGetCursorName: Out:*CursorName = "SQL_CUR_21"
SQLAllocHandle: HandleType = SQL_HANDLE_STMT=3
SQLExecDirect: StatementText = "EXPLAIN options 'f' "SQL_CUR_21"
SQLPrepare:
In: StatementHandle = 0x003B1A10,
StatementText = "select * from odbc_persnl.employee;", TextLength = 35
Return: SQL_SUCCESS=0
112
SQL Statements

Advertisement

Table of Contents
loading

Table of Contents