home -> developer -> SQL -> tutorial -> GetCoffee -> lambda

back next

Making a lambda

An operational resource is implemented by a resource of type <http://waterken.com/sql/lambda/Lambda>.


Like a <Record>, a <Lambda> is implemented by wrapping an SQL resource.

For example, open the SQL query resource <n3e33rggqunehn6r3wo2kmqmfu.xml> in the xdb folder. The query is similar to other queries you have seen. The only difference is that is has parameters. The coffee name parameter is shown as a question mark, "?", in the SQL statement.

Now open the <GetCoffee> resource <fbmg5qohwnibnqnfzeph6cn6uq.xml> in the xdb folder.

The statement link field links to the above SQL query resource.

The type field refers to the previously described <GetCoffee> schema.

The guards list allows you to perform runtime checks on the arguments provided by the user. Guard types include:

The coffee name is not constrained, so the guard is <Any>. This guard accepts any data. Every argument must have a guard, hence the <Any> option. Guards must appear in the same order as the parameters they restrict.

Run it

Click here to view the representation on your machine.

Enter a coffee name, such as "Colombian" and submit the form. The server returns a <Coffee>.

The next section describes creating an update resource.


Copyright 2002 - 2003 Waterken Inc. All rights reserved.

Powered by Waterken Server! Valid XHTML 1.0! Valid CSS!