DB db = openDatabase("myDB");
Reln r = openRel(db,"Enrolments");
Scan s = startScan(r);
Tuple t; Results res = NULL;
while ((t = nextTuple(s)) != NULL)
{
int stuid = getField(t,"student");
char *course = getField(t,"course");
res = addTuple(res, mkTuple(stuid,course));
}
|