ibec_GetStatementExplainPlan

ibec_GetStatementPlan returns the standard InterBase/Firebird plan of the specified statement. ibec_GetStatementExplainPlan returns the extended plan which is available when working with the Firebird 3 server.

Syntax

function ibec_GetStatementExplainPlan(Database : variant; 
                                     Statement : string; 
                                     RaiseError : boolean) : variant;

The RaiseError parameter specifies how to handle possible errors when requesting a plan. If RaiseError is equal to TRUE and an error occurs, an error will be raised and both functions will return an error message as a result. Otherwise in case of error functions it just returns an empty string.

Example

 execute ibeblock
 as
 begin
   db = ibec_GetDefaultConnection();
   sQuery = 'select * from rdb$fields where rdb$field_name = :field_name';
   sPlan = ibec_GetStatementPlan(db, sQuery, FALSE);
   sQuery = 'select * from rdb$relations where rdb$relation_name = ?';
   sPlan = ibec_GetStatementPlan(db, sQuery, FALSE);
 end