cursor/printAdultsInReverseSortedOrder.c
{
RDM_RETCODE rc;
RDM_CURSOR adults = NULL;
ADULT fAdult;
bool is_before_first;
rc = rdm_dbGetRowsByKey (db, KEY_ADULT_ADULT_NAME, &adults);
{
rc = rdm_cursorMoveToLast (adults);
}
rc = rdm_cursorIsBeforeFirst (adults, &is_before_first);
{
if (rc == sOKAY)
{
printf (
"Adult with id: %d and name: %s\n", fAdult.adult_id,
fAdult.adult_name);
rc = rdm_cursorMoveToPrevious (adults);
}
rc = sOKAY;
if (rc == sOKAY)
{
rc = rdm_cursorIsBeforeFirst (adults, &is_before_first);
}
}
rdm_cursorFree (adults);
return rc;
}
RDM_RETCODE rdm_cursorReadRow(RDM_CURSOR cursor, void *colValues, size_t bytesIn, size_t *bytesOut)
Read all columns from a row.
RDM_RETCODE rdm_cursorIsBeforeFirst(RDM_CURSOR cursor, bool *isBeforeFirst)
Check to see if a cursor is positioned before the first row in a collection.
RDM_RETCODE rdm_dbGetRowsByKey(RDM_DB db, RDM_KEY_ID keyId, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with a row set based on a key.