Chapter 2: ColdFusion Functions
483
QueryAddRow
Adds a specified number of empty rows to the specified query. Returns the total
number of rows in the query that you are adding rows to.
See also
QueryNew
,
QueryAddColumn
and
QuerySetCell
.
Syntax
QueryAddRow
(
query [, number ])
query
Name of the query already executed.
number
Number of rows to add to the query. Default is 1.
Example
<!--- This example shows the use of QueryAddRow and QuerySetCell --->
<HTML>
<HEAD>
<TITLE>
QueryAddRow Example
</TITLE>
</HEAD>
<BODY>
<H3>QueryAddRow Example</H3>
<!--- start by making a query --->
<CFQUERY NAME="GetCourses" DATASOURCE="cfsnippets">
SELECT Course_ID, Number, Descript
FROM Courses
</CFQUERY>
<P>The Query "GetCourses" has <CFOUTPUT>#GetCourses.RecordCount#
</CFOUTPUT> rows.
<CFSET CountVar = 0>
<CFLOOP CONDITION="CountVar LT 15">
<CFSET temp = QueryAddRow(GetCourses)>
<CFSET CountVar = Co 1>
<CFSET Temp = QuerySetCell(GetCourses, "Course_ID", CountVar)>
<CFSET CountVar = Co 1>
<CFSET Temp = QuerySetCell(GetCourses, "Number", 100*CountVar)>
<CFSET CountVar = Co 1>
<CFSET Temp = QuerySetCell(GetCourses, "Descript",
"Description of variable #Countvar#")>
</CFLOOP>
...
Summary of Contents for COLDFUSION 4.5-CFML LANGUAGE
Page 1: ...Allaire Corporation CFML Language Reference ColdFusion 4 5...
Page 207: ...Chapter 1 ColdFusion Tags 183 CFCATCH CFTRY BODY HTML...
Page 224: ...200 CFMLLanguageReference CFOUTPUT P Text within CFOUTPUT is always shown CFOUTPUT BODY HTML...
Page 336: ...312 CFMLLanguageReference CFIF BODY HTML...
Page 404: ...380 CFMLLanguageReference DE It is morning CFOUTPUT P BODY HTML...
Page 413: ...Chapter 2 ColdFusion Functions 389 Customer BalanceDue BR CFOUTPUT CFIF BODY HTML...
Page 483: ...Chapter 2 ColdFusion Functions 459 CFOUTPUT CFLOOP BODY HTML...
Page 584: ...560 CFMLLanguageReference...
Page 594: ...570 CFMLLanguageReference...