skip to main content
Designing and coding the IP : SELECT processing : Cursor-Based SELECT processing : Using dam_isTargetRow to evaluate a row
 

Using dam_isTargetRow to evaluate a row

The OpenAccess SDK SQL engine provides the dam_isTargetRow function for evaluating a row of data using the conditions in the WHERE clause of the SQL query. The IP calls this function to determine whether a row matches the WHERE clause of the query. This function takes a row handle and a statement handle as inputs and evaluates a row against a SQL statement. The function returns DAM_TRUE if the input row meets the restrictions of the SQL expression, DAM_FALSE if it does not, and DAM_ERROR if the row handle is invalid or not all required column values have been set.
Note: Remember to throw away rows (and free the associated memory) for rows that fail to comply with the WHERE clause. If you do not, the OpenAccess SDK SQL engine discards them when the execution of the current query is finished. This may impact performance and the size of results you can handle.
If a row passes evaluation and the OpenAccess SDK SQL engine is executing a SELECT, then the IP must add the row to the result set using the dam_addRowToTable call. If the OpenAccess SDK SQL engine is processing a DELETE or UPDATE, then the IP must perform the steps to delete or update the row. If a row fails evaluation, then the IP must free the row using dam_freeRow. Do not free rows that have been added using the dam_addRowToTable function.