skip to main content
Implementing SQL pass-through mode : Selective SQL pass-through : Execution sequence
 

Execution sequence

After validating the query, the OpenAccess SDK SQL engine checks whether the IP supports selective query execution mode. If the IP supports Query Execution Mode Selection, then the OpenAccess SDK SQL engine calls IP EXECUTE with StmtType set to DAM_SET_QUERY_MODE.
IP EXECUTE should check the query details by using the Parse Tree API and if it can handle the query in pass-through mode, call dam_setOption(DAM_STMT_OPTION_PASSTHROUGH_QUERY) to indicate that it wants to handle this query in SQL pass-through mode. Once this option is set for the query, query execution follows Pass-Through query mode. Otherwise, the query is executed in row-based mode. When IP EXECUTE is called for actual query execution with DAM_SELECT, the IP can verify execution mode by calling dam_getInfo(DAM_INFO_PASSTHROUGH_QUERY). The value will be returned as 1 if query execution is pass-through mode.
IP Execute must be coded to handle query execution of both row-based mode and pass-through mode.