cursor/printParentNames.c
static RDM_RETCODE printParentNames (RDM_CURSOR child)
{
char name[32];
RDM_CURSOR parent = NULL;
rc = rdm_cursorGetOwnerRow (child, REF_MOTHERS_CHILDREN, &parent);
if (rc == eNOTLINKED)
{
rc = sOKAY;
printf ("Unknown mother\n");
}
else if (rc == sOKAY)
{
parent, COL_ADULT_ADULT_NAME, name, sizeof (name), NULL);
if (rc == sOKAY)
{
printf ("Mother: %s\n", name);
}
}
if (rc == sOKAY)
{
rc = rdm_cursorGetOwnerRow (child, REF_FATHERS_CHILDREN, &parent);
}
if (rc == eNOTLINKED)
{
rc = sOKAY;
printf ("Unknown father\n");
}
else if (rc == sOKAY)
{
parent, COL_ADULT_ADULT_NAME, name, sizeof (name), NULL);
if (rc == sOKAY)
{
printf ("Father: %s\n", name);
}
}
rdm_cursorFree (parent);
return rc;
}
@ eNOTLINKED
Definition: rdmretcodetypes.h:261
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_cursorReadColumn(RDM_CURSOR cursor, RDM_COLUMN_ID columnId, void *columnValue, size_t bytesIn, size_t *bytesOut)
Read a single column from a table row.
RDM_RETCODE rdm_cursorGetOwnerRow(RDM_CURSOR memberCursor, RDM_REF_ID refId, RDM_CURSOR *pCursor)
Associate an RDM_CURSOR with a set owner.