cursor/printAdults.c
static
RDM_RETCODE
printAdults (
RDM_CURSOR
adults)
{
ADULT fAdult;
RDM_CURSOR
adultsIter = NULL;
RDM_RETCODE
rc;
/* Clone adults so we can leave its position as is */
rc =
rdm_cursorGetClone
(adults, &adultsIter);
if
(rc ==
sOKAY
|| rc ==
sENDOFCURSOR
)
{
rc =
rdm_cursorMoveToFirst
(adultsIter);
}
while
(rc ==
sOKAY
)
{
rc =
rdm_cursorReadRow
(adultsIter, &fAdult,
sizeof
(fAdult), NULL);
if
(rc ==
sOKAY
)
{
printf (
"Adult with id: %d and name: %s\n"
, fAdult.adult_id,
fAdult.adult_name);
rc =
rdm_cursorMoveToNext
(adultsIter);
}
}
if
(rc ==
sENDOFCURSOR
)
rc =
sOKAY
;
rdm_cursorFree
(adultsIter);
return
rc;
}