|
Web+ Tutorial
|
Lesson 6.1 - Submitting a query to a database
You can submit a query to an ODBC datasource using the webDBQuery statement. Then, when you add the name of that query as an attribute to a webPrint statement, everything within the webPrint block will be processed once for each record returned by the query. The new syntax for the webPrint statement is: <webPrint query = queryname> ... </webPrint>
- Description
- Submits a SQL query to a database.
- Syntax
<webDbQuery NAME=QueryName DATASOURCE=ODBCDataSourceName SQL=SQLstatement [MAXROWS=MaximunNumberOfRows] [TIMEOUT=Milliseconds] [DEBUG]>
- Agument
- /tutorial/argument/arg27.wml
- Example
<webDbQuery NAME="Customer List" DATASOURCE="Customer DB"SQL="Select * From CustomerTable"> <webPrint Query="Customer List">#LastName#, #FirstName# #CompanyName# - #Email# </webPrint>
- Exercise
- This example is for your reference. You can try it on your own system.
You can try out some Web+ code of your own here.
|
|