cursor/insertAdults.c
static RDM_RETCODE insertAdults (
const ADULT *adults,
uint32_t nAdults,
RDM_DB db)
{
RDM_CURSOR inserted = NULL;
uint32_t ii;
for (ii = 0; rc == sOKAY && ii < nAdults; ii++)
{
printf (
"Insert adults with id: %d and name: %s\n", adults[ii].adult_id,
adults[ii].adult_name);
/* We could pass in NULL instead of 'inserted' below */
db, TABLE_ADULT, &adults[ii], sizeof (ADULT), &inserted);
}
rdm_cursorFree (inserted);
return rc;
}
struct RDM_CURSOR_S * RDM_CURSOR
Definition: rdmtypes.h:306
@ sOKAY
Definition: rdmretcodetypes.h:96
RDM_RETCODE rdm_cursorFree(RDM_CURSOR cursor)
Free an RDM_CURSOR.
RDM_RETCODE rdm_dbInsertRow(RDM_DB db, RDM_TABLE_ID tableId, const void *colValues, size_t bytesIn, RDM_CURSOR *pCursor)
Insert a new row into a table at the specified rowId.
struct RDM_DB_S * RDM_DB
Definition: rdmtypes.h:305
RDM_RETCODE
RDM status and error return codes.
Definition: rdmretcodetypes.h:44