cursor/printANumberOfAdultsArroundRecord.c
static RDM_RETCODE printANumberOfAdultsArroundRecord (
RDM_CURSOR adult,
uint32_t num)
{
RDM_RETCODE rc;
ADULT fAdult;
RDM_CURSOR adults = NULL;
uint32_t ii;
rc = rdm_cursorGetRowsAtPosition (adult, &adults);
{
rc = rdm_cursorMoveToPrevious (adults);
}
{
rc = rdm_cursorMoveToNext (adults);
}
for (ii = 0; rc == sOKAY && ii < num; ii++)
{
if (rc == sOKAY)
{
printf (
"Adult with id: %d and name: %s\n", fAdult.adult_id,
fAdult.adult_name);
rc = rdm_cursorMoveToNext (adults);
}
}
if (rc == sENDOFCURSOR)
rc = sOKAY;
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_cursorGetRowsAtPosition(RDM_CURSOR sourceCursor, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with rows from a table ordered by rowid and positioned to the same row as the...