home -> developer -> SQL -> tutorial -> price list

back next

A composite record: price list

SQL operates on tables of primitive datatypes. Often, column values are not independent pieces of information, but components of a composite datatype. Using an SQL query resource, you can reassemble these column values into the composite datatype before returning the data to the client.

Prototype

Reassembly of a composite datatype from its component values is expressed using a prototype. A prototype is an instance of the composite datatype where, instead of the component values, named holes show where the component values are to be inserted.

For example, the Coffeebreak application has a price list resource. The price list is a list of <http://waterken.com/coffeebreak/Coffee>s. Each <Coffee> has a 'name' component and a 'price' component. The price list SQL query resource links to a <Coffee> prototype that shows how to construct a <Coffee> from the SQL statement result set.

The first step in creating a prototype is creating the schema that defines the structure of the composite datatype. The next page describes the <Coffee> schema.

top

Copyright 2002 - 2003 Waterken Inc. All rights reserved.

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