cursor/printOurCommonChildrenNames.c
static RDM_RETCODE printOurCommonChildrenNames (
RDM_CURSOR mother,
RDM_CURSOR father)
{
char name[32];
RDM_CURSOR mothersChildren = NULL;
RDM_CURSOR fathersChildren = NULL;
mother, REF_MOTHERS_CHILDREN,
&mothersChildren);
if (rc == sOKAY)
{
father, REF_FATHERS_CHILDREN, &fathersChildren);
}
if (rc == sOKAY)
{
rc = rdm_cursorMoveToNext (mothersChildren);
}
/* Iterate over all mothers children */
while (rc == sOKAY)
{
rc = rdm_cursorMoveToPosition (fathersChildren, mothersChildren);
if (rc == eNOTINCURSOR)
{
rc = sOKAY;
}
else if (rc == sOKAY)
{
mothersChildren, COL_CHILD_CHILD_NAME, name, sizeof (name),
NULL);
if (rc == sOKAY)
{
printf ("Common child: %s\n", name);
}
}
if (rc == sOKAY)
{
rc = rdm_cursorMoveToNext (mothersChildren);
}
}
if (rc == eNOTOWNER || rc == sENDOFCURSOR)
rc = sOKAY;
rdm_cursorFree (mothersChildren);
rdm_cursorFree (fathersChildren);
return rc;
}
RDM_RETCODE rdm_cursorMoveToNext(RDM_CURSOR cursor)
Position a cursor to the next row in the collection.
@ eNOTOWNER
Definition: rdmretcodetypes.h:255
RDM_RETCODE rdm_cursorMoveToPosition(RDM_CURSOR cursor1, RDM_CURSOR cursor2)
Position a cursor based on the currow row of another cursor.
@ sENDOFCURSOR
Definition: rdmretcodetypes.h:58
@ eNOTINCURSOR
Definition: rdmretcodetypes.h:266
struct RDM_CURSOR_S * RDM_CURSOR
Definition: rdmtypes.h:347
@ sOKAY
Definition: rdmretcodetypes.h:100
RDM_RETCODE rdm_cursorFree(RDM_CURSOR cursor)
Free an RDM_CURSOR.
enum RDM_RETCODE_E RDM_RETCODE
RaimaDB status and error return codes.
RDM_RETCODE rdm_cursorGetMemberRows(RDM_CURSOR ownerCursor, RDM_REF_ID refId, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with members.
RDM_RETCODE rdm_cursorReadColumn(RDM_CURSOR cursor, RDM_COLUMN_ID columnId, void *columnValue, size_t bytesIn, size_t *bytesOut)
Read a single column from a table row.