skip to main content
Implementing Table Expression Pushdown : About Table Expression Pushdown : Checking if Partial Search Expression is Returned
 

Checking if Partial Search Expression is Returned

When query conditions contain correlated subqueries that cannot be exposed to the IP, the dam_getTableSearchExp() returns the value of pbPartial as TRUE. In all other cases, pbPartial will be returned as FALSE and the entire search expression is returned to the IP.
If pbPartial is TRUE, it indicates that some conditions have not been exposed to the IP. The IP should call dam_isTargetRow() to allow OpenAccess SDK SQL engine to validate the conditions that were not exposed.
Example:
SELECT deptno, ename, sal FROM emp x WHERE sal > 1000 AND deptno =(SELECT deptno FROM dept WHERE deptno = x.deptno);
When the IP calls dam_getTableSearchExp() for emp table, pbPartialExp will be returned as TRUE and only “sal > 1000” will be returned in phSearchExp. The IP should call dam_isTargetRow before using dam_addRowToTable.