ziv@2290: table tab : {Id : int, Val : int} PRIMARY KEY Id
ziv@2290:
ziv@2290: fun check id =
ziv@2290: res <- oneOrNoRows (SELECT tab.Val FROM tab WHERE tab.Id = {[id]});
ziv@2290: return
ziv@2293: Value at {[id]} is
ziv@2290: {case res of
ziv@2293: None => unknown
ziv@2293: | Some row => {[row.Tab.Val]}}.
ziv@2290:
ziv@2290:
ziv@2290: fun flush id =
ziv@2290: dml (UPDATE tab SET Val = Val + 1 WHERE Id = {[id]});
ziv@2290: return
ziv@2293: Incremented value at {[id]} (if it exists).
ziv@2290: