Gets a condition of the current query.
struct resbuf*
ade_qrygetcond(
ade_id condition_id);
Returns a query condition or NULL.
condition_id | Query condition ID. |
You must release the resbuf.
See ade_qrydefine for information about query conditions.
The following sample shows the use of ade_qrygetcond() only. A resbuf is created, the resbuf is filled based on the return of ade_qrygetcond(). Then it releases the resbuf, as required.
struct resbuf* pNewQueryConditionRb = NULL; pNewQueryConditionRb = ade_qrygetcond(queryId); acutRelRb(pQueryConditionRb);
The following sample shows the use of ade_qrygetcond() in conjunction with ade_qrydefine().
char* pszJoinOperator = ""; // none char* pszBgnCondGrouping = ""; // none char* pszNotOperator = ""; // none char* pszCondType = "Property"; char* pszEndCondGrouping = ""; // none struct resbuf* pQueryConditionRb = acutBuildList( RTLB, RTSTR, "feature", RTSTR, "=", RTSTR, "Pond", RTLE, 0 ); ade_id queryId = ade_qrydefine( pszJoinOperator, pszBgnCondGrouping, pszNotOperator, pszCondType, pQueryConditionRb, pszEndCondGrouping); if (queryId != ADE_NULLID) { acutPrintf( "\nA query has been defined with the following condition:\n\n"); } else { acutPrintf( "\nThere are no defined queries."); } acutRelRb(pQueryConditionRb); struct resbuf* pNewQueryConditionRb = ade_qrygetcond(queryId); if(NULL != pNewQueryConditionRb) { struct resbuf* rb = pNewQueryConditionRb; while(NULL != rb) { if(rb->restype == RTSTR){ acutPrintf( "\"%s\" " , rb->resval.rstring); } rb = rb->rbnext; } } else{ acutPrintf( "\nNo information could be retrieved."); } acutRelRb(pNewQueryConditionRb);
After running the code, take notice of how the command line display matches the ade_qrydefine() parameter list.