Mercurial > urweb
comparison tests/pquery.ur @ 280:fdd7a698be01
Compiling a parametrized query the inefficient way
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 02 Sep 2008 17:31:45 -0400 |
parents | |
children | 1afa94582275 |
comparison
equal
deleted
inserted
replaced
279:8bb46d87b074 | 280:fdd7a698be01 |
---|---|
1 table t1 : {A : int, B : string, C : float} | |
2 | |
3 fun lookup (inp : {B : string}) = | |
4 s <- query (SELECT t1.B FROM t1 WHERE t1.B = {inp.B}) | |
5 (fn fs _ => return fs.T1.B) | |
6 "Couldn't find it!"; | |
7 return <html><body> | |
8 Result: {cdata s} | |
9 </body></html> | |
10 | |
11 fun main () : transaction page = return <html><body> | |
12 <lform> | |
13 B: <textbox{#B}/> | |
14 <submit action={lookup}/> | |
15 </lform> | |
16 </body></html> |