[prev] 11 [next]

Storage Manager Interface (cont)

Implementation at level of query executor:   (not PostgreSQL)

DB db = openDatabase("myDB");
Reln r = openRelation(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));
}