Queryaddrow - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

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,
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 = CountVar + 1>
<CFSET Temp = QuerySetCell(GetCourses, "Course_ID", CountVar)>
<CFSET CountVar = CountVar + 1>
<CFSET Temp = QuerySetCell(GetCourses, "Number", 100*CountVar)>
<CFSET CountVar = CountVar + 1>
<CFSET Temp = QuerySetCell(GetCourses, "Descript",
"Description of variable #Countvar#")>
</CFLOOP>
...
QueryAddColumn
and QuerySetCell.
483

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents