cursor/printParentNames.c
{
RDM_RETCODE rc;
char name[32];
RDM_CURSOR parent = NULL;
rc = rdm_cursorGetOwnerRow (child, REF_MOTHERS_CHILDREN, &parent);
{
rc = sOKAY;
printf ("Unknown mother\n");
}
{
rc = rdm_cursorReadColumn (
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");
}
{
rc = rdm_cursorReadColumn (
parent, COL_ADULT_ADULT_NAME, name, sizeof (name), NULL);
if (rc == sOKAY)
{
printf ("Father: %s\n", name);
}
}
rdm_cursorFree (parent);
return rc;
}
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.