summaryrefslogtreecommitdiff
path: root/tests/pquery.ur
blob: 0ccbc9f238e5d9f9af4a6299354a4214d1482ad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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>