Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 437

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Code
<cfoutput query=detail>
#Emp_ID#: #FirstName# #LastName# <br>
</cfoutput>
<cfoutput>
#master.columnlist#<br>
</cfoutput>
<cfoutput>
#detail.columnlist#<br>
</cfoutput>
Displaying recordset data incrementally
If your database is large, you can limit the number of rows displayed at one time. The following example shows how
to do this using the
currentRow
"Getting information about query
Create a ColdFusion page with the following content:
1
<html>
<head>
<title>QoQ with incremental row return</title>
</head>
<body>
<h3>QoQ with incremental row return</h3>
<!--- define startrow and maxrows to facilitate 'next N' style browsing --->
<cfparam name = "MaxRows" default = "5">
<cfparam name = "StartRow" default = "1">
<!--- master query: retrieve all info from Employee table --->
<cfquery name = "GetSals" datasource = "cfdocexamples">
SELECT * FROM Employee
ORDER BY LastName
</cfquery>
<!--- detail query: select 3 fields from the master query --->
<cfquery name = "GetSals2" dbtype = "query">
SELECT FirstName, LastName, Salary
FROM GetSals
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>
Description
Uses the detail query to display the list of employee IDs, first names, and
last names.
Lists all the columns returned by the master query.
Lists all the columns returned by the detail query.
query variable of a Query of Queries. For more information on query variables, see
results" on page 414.
Last updated 1/20/2012
432

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents