The following program fragments: o Declare a database o Enter an RDML FOR loop, implicitly opening the database o Print the last name of each employee in EMPLOYEES o Commit the transaction o Close the database
1 – C Example
#include <stdio.h> DATABASE PERS = FILENAME "PERSONNEL"; main() { FOR E IN EMPLOYEES printf ("%s\n", E.LAST_NAME); END_FOR; COMMIT; FINISH; }
2 – Pascal Example
program empupdate (input,output); DATABASE PERS = FILENAME 'PERSONNEL'; begin FOR E IN EMPLOYEES writeln (E.LAST_NAME); END_FOR; COMMIT; FINISH; end.