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@2292: cache
ziv@2290: {case res of
ziv@2290: None => ?
ziv@2290: | 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@2290: Changed {[id]}!
ziv@2290: