MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 458

Developing coldfusion mx applications
Table of Contents

Advertisement

<!--- master query: retrieve all info from Employee table --->
<cfquery name = "GetSals" datasource = "CompanyInfo">
SELECT * FROM Employee
ORDER BY LastName
</cfquery>
<!--- detail query: select 3 fields from the master query --->
<cfquery name = "GetSals2" dbtype = "query">
SELECT
FROM
ORDER BY LastName
</cfquery>
<!--- build table to display output --->
<table cellpadding = 1 cellspacing = 1>
<tr>
<td bgcolor = f0f0f0>
<b><i>&nbsp;</i></b>
</td>
<td bgcolor = f0f0f0>
<b><i>FirstName</i></b>
</td>
<td bgcolor = f0f0f0>
<b><i>LastName</i></b>
</td>
<td bgcolor = f0f0f0>
<b><i>Salary</i></b>
</td>
</tr>
<!--- Output the query and define the startrow and maxrows
parameters. Use the query variable currentRow to
keep track of the row you are displaying. --->
<cfoutput query = "GetSals2" startrow = "#StartRow#" maxrows =
"#MaxRows#">
<tr>
<td valign = top bgcolor = ffffed>
<b>#GetSals2.currentRow#</b>
</td>
<td valign = top>
<font size = "-1">#FirstName#</font>
</td>
<td valign = top>
<font size = "-1">#LastName#</font>
</td>
<td valign = top>
<font size = "-1">#Salary#</font>
</td>
</tr>
</cfoutput>
<!--- If the total number of records is less than or equal to
the total number of rows, provide a link to the same page, with the
StartRow value incremented by MaxRows (5, in this example) --->
458
Chapter 22: Using Query of Queries
FirstName, LastName, Salary
GetSals

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents