Integrating Web Pages with Databases 
by David Cox

Example 1:
<CFQUERY NAME="Catalog" DATASOURCE="ProductCatalog">
    SELECT Name, Size, Price FROM Product;
</CFQUERY>
<CFOUTPUT QUERY="Catalog">
    #Description#, #Size#, #Price#<BR>
</CFOUTPUT>

Example 2:
(a)
Datasource: ProductCatalog
Template: prodlist.htx
SQLStatement: SELECT Name, Size, Price FROM Product

(b)
<P>
<%Name%>, <%Size%>, <%Price%>
</P>

Example 3:
(a)
<!-- !InsertResultTable <tablename> <datasource> <userid> <password> <sql>-->

(b)
<!-- !InsertResultTable Catalog ProductCatalog SELECT Name, Size, Price from Product-->

Example 4:
var Catalog = new Object();
Catalog.Name = Array();
Catalog.Size = Array();
Catalog.Price = Array();

Catalog.Name[0] = "Shirt";
Catalog.Name[1] = "Pants";
Catalog.Name[2] = "Shoes";

Catalog.Size[0] = "Large";
Catalog.Size[1] = "36";
Catalog.Size[2] = "9";

Catalog.Price[0] = "20.00";
Catalog.Price[1] = "40.00";
Catalog.Price[2] = "60.00";

Example 5:

<HEAD>
<SCRIPT language="Javascript">
 <!-- !InsertResultTable Catalog ProductCatalog 
          SELECT Name, Size, Price from Product-->
</SCRIPT>
</HEAD>
<BODY>
<!-- more Javascript code to manipulate the data -->
</BODY>

Example 6:
(a) 
http://mywebsite/ceres.exe?htmlfile=prodlist.html

(b)
http://mywebsite/ceres.exe?htmlfile=prodlist.html&Name=Pants

(c)
<!-- !InsertResultTable Catalog ProductCatalog SELECT Name, Size, 
                Price from Product where Name=@Name-->

(d)
http://mywebsite/ceres.exe?htmlfile=prodlist.html&Name=
                Pants&pagesize=10&page=3






2


