diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/pquery.ur	Tue Sep 02 17:31:45 2008 -0400
@@ -0,0 +1,16 @@
+table t1 : {A : int, B : string, C : float}
+
+fun lookup (inp : {B : string}) =
+        s <- query (SELECT t1.B FROM t1 WHERE t1.B = {inp.B})
+                (fn fs _ => return fs.T1.B)
+                "Couldn't find it!";
+        return <html><body>
+                Result: {cdata s}
+        </body></html>
+
+fun main () : transaction page = return <html><body>
+        <lform>
+                B: <textbox{#B}/>
+                <submit action={lookup}/>
+        </lform>
+</body></html>