Mercurial > urweb
diff tests/sql_ops.ur @ 559:5d494183ca89
Add SQL arithmetic operators
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 09 Dec 2008 14:41:19 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/sql_ops.ur Tue Dec 09 14:41:19 2008 -0500 @@ -0,0 +1,8 @@ +table t : { A : int, B : float } + +val q = (SELECT t.A + t.A AS X, t.B * t.B AS Y FROM t) + +fun main () : transaction page = + xml <- queryX q (fn r => <xml>{[r.X]}, {[r.Y]}<br/></xml>); + return <xml><body>{xml}</body></xml> +