C Examples: DbiInsertRecord

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiInsertRecord

Return to chapter overview

Append or insert a record on the specified table.

If the table has an index, insert the record; otherwise, append the record. This example uses the following input:
         fAddRecord(hCur, pRecBuf);

DBIResult fAddRecord(hDBICur hTmpCur, pBYTE pTmpRecBuf)

{

  DBIResult        rslt;

  CURProps         CurProps;

  rslt = Chk(DbiGetCursorProps(hTmpCur, &CurProps));

  if (rslt != DBIERR_NONE)

     return rslt;

  if (CurProps.iIndexes == 0)

     rslt = Chk(DbiAppendRecord(hTmpCur, pTmpRecBuf));

  else

     rslt = Chk(DbiInsertRecord(hTmpCur, dbiNOLOCK, pTmpRecBuf));

  return rslt;

}