blob: 257f8c551271e808fbb22a6d258eb9b227f33195 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
table t : { O : option int }
fun addNull () =
dml (INSERT INTO t (O) VALUES (NULL));
return <xml>Done</xml>
(*fun add42 () =
dml (INSERT INTO t (O) VALUES (42));
return <xml>Done</xml>*)
fun main () : transaction page =
xml <- queryX (SELECT * FROM t)
(fn r => case r.T.O of
None => <xml>Nada<br/></xml>
| Some n => <xml>Num: {[n]}<br/></xml>);
return <xml><body>
{xml}
<a link={addNull ()}>Add a null</a><br/>
</body></xml>
(* <a link={add42 ()}>Add a 42</a><br/>*)
|