C Examples: DbiQExecDirect

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiQExecDirect

Return to chapter overview

Execute a SQL Statement and return the numbers in the result set if applicable:

Note that Count will be 0 if a result set is not created. The following input is used in this example: fDbiQExecDirect("Select * from 'CUST.DBF'", hDb, &hTmpCur, &Count);

 

DBIResult fDbiQExecDirect(pCHAR QryStr, hDBIDb hTmpDb, phDBICur phTmpCur, pUINT32 Count)

{

   DBIResult   rslt;

 

   *Count = 0;

   rslt = Chk(DbiQExecDirect(hTmpDb, qrylangSQL, QryStr, phTmpCur));

   if (rslt == DBIERR_NONE)

   {

      if (*phTmpCur != 0)

         Chk(DbiGetRecordCount(*phTmpCur, Count));

   }

   return rslt;

}