|
|||||||||||||
Making a queryA query resource contains an SQL statement and specifies how to format the result table. Weekly sales queryNavigate to your xdb folder. In a browser, go to the root folder of your WaterkenTM installation. Click "xdb". On the next page, click "www.example.com" and then "coffeebreak". This directory is your coffeebreak xdb folder. Whenever I ask you to open something in your xdb folder, I am referring to this directory. You may want to bookmark it.
Open the weekly sales query If you have your history list open, notice this page has an entry of "Edit: WeeklySales query." The history can help you navigate in the xdb folder by providing you with human-memorable descriptions. Getting helpIn every editor, you can click on the editor title, such as "Map Query Editor", to view a detailed help page. You may also roll your mouse over labels or input elements for a brief description of the element. Most labels also link to a schema, which gives you more information. The comment textarea contains a description of the query. The first sentence of the comment is used as the page title, which is the history list entry. SQL codeThe SQL code field specifies the SQL statement. This statement should be in whatever version of SQL your database accepts. As is standard, use question marks ("?") to stand in for parameters. The weekly sales query does not require any parameters. Map constructionThe key and value fields tell the server how to construct the map that it returns. Since the weekly sales query returns a map of primitive types, a string to an integer, the "primitive" radio button is selected. The field adjacent to the radio button specifies which data to use for the key and which for the value. The weekly sales SQL statement fetches the coffee name from "COF_NAME" and the sales from "SALES". To use the coffee name as the map key, "COF_NAME" appears in the key primitive input. "SALES" appears in the value primitive input. The Webizer also supports composite datatypes, datatypes composed of more than one table column value. You will see an example of using a composite datatype in the price list example. To make the weekly sales query invokable, we must wrap it in a record. The next page discusses creating a record. | |||||||||||||
|
top
Copyright 2002 - 2003 Waterken Inc. All rights reserved. |