Mercurial > urweb
comparison tests/rpcN.ur @ 614:5891f47d7cff
Parameterized RPC query
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 15 Feb 2009 13:03:09 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
613:c5991cdb0c4b | 614:5891f47d7cff |
---|---|
1 table t : { A : int } | |
2 | |
3 fun main () : transaction page = | |
4 let | |
5 fun count a = r <- oneRow (SELECT COUNT( * ) AS N FROM t WHERE t.A = {[a]}); | |
6 return r.N | |
7 in | |
8 s <- source 0; | |
9 return <xml><body> | |
10 <button value="Get It On!" | |
11 onclick={n <- count 3; | |
12 set s n}/><br/> | |
13 <br/> | |
14 Current: <dyn signal={n <- signal s; return <xml>{[n]}</xml>}/> | |
15 </body></xml> | |
16 end |