summaryrefslogtreecommitdiff
path: root/tests/pquery.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-09-02 17:31:45 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-09-02 17:31:45 -0400
commitab29ac3337d2be88ae3288652e999873be1dcf14 (patch)
treed3816565ec3c8518bb73979bd5957e8d324375f9 /tests/pquery.ur
parent5885d66bebeece6ba2f7b6a1b11f719086423114 (diff)
Compiling a parametrized query the inefficient way
Diffstat (limited to 'tests/pquery.ur')
-rw-r--r--tests/pquery.ur16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/pquery.ur b/tests/pquery.ur
new file mode 100644
index 00000000..0ccbc9f2
--- /dev/null
+++ b/tests/pquery.ur
@@ -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>