Skip to content

SQLGetPlan

SQLGetPlan#

This is nonstandard function returning execution information.

Syntax#

SQLRETURN SQLGetPlan (
    SQLHSTMT    stmt,
    SQLCHAR**   aPlan);

Arguments#

Data Type Argument In/Output Description
SQLHSTMT stmt Input Input statement handle
SQLCHAR** aPlan Output Pointer to store output execution information

Returned Values#

SQL_SUCCESS
SQL_ERROR

Description#

SQLGetPlan is nonstandard function, but you can use it when retrieving information of execution plan.

At this time, the user shouldn't modify information returned by aPlan.

SQLSetConnectAttr

Example#

< Refer to: $ALTIBASE_HOME/sample/SQLCLI/demo_plan.cpp >

if( SQLSetConnectAttr( dbc, ALTIBASE_EXPLAIN_PLAN,
                           (SQLPOINTER) 1, 0) != SQL_SUCCESS)
.
.
.
    if ( SQLGetPlan(stmt, (SQLCHAR**)&plan) != SQL_SUCCESS )