Mercurial > urweb
comparison tests/ascdesc.ur @ 1543:6f046b4bad24
Add antiquote for ORDER BY directions
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Fri, 19 Aug 2011 14:20:24 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1542:dc4c61363d0a | 1543:6f046b4bad24 |
---|---|
1 table t : { A : int } | |
2 | |
3 fun sortEm b = | |
4 queryX1 (SELECT * FROM t ORDER BY t.A {if b then sql_asc else sql_desc}) | |
5 (fn r => <xml>{[r.A]}; </xml>) | |
6 | |
7 fun main () : transaction page = return <xml><body> | |
8 <a link={sortEm True}>Ascending</a><br/> | |
9 <a link={sortEm False}>Descending</a> | |
10 </body></xml> |