![MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference Download Page 505](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-cfml-language/coldfusion-4-5-cfml-language_reference_3287257505.webp)
Chapter 2: ColdFusion Functions
481
QueryAddColumn
Adds a new column to a specified query and populates the column’s rows with the
contents of a one-dimensional array. Returns the query object with the additional
column. Padding is added, if necessary, on the query columns to ensure that all
columns have the same number of rows.
See also
CFQUERY
,
QueryNew
,
QueryAddRow
and
QuerySetCell
.
Syntax
QueryAddColumn
(
query, column-name, array-name)
query
Name of a query that was created with QueryNew.
column-name
The name of the new column.
array-name
The name of the array whose elements are to populate the new column.
Usage
You can add columns to any type of query object, such as queries retrieved with
CFQUERY or queries created with QueryNew. The only type of query that you cannot
use QueryAddColumn on is a cached query.
This function is particularly useful if you are an Oracle developer and would like to
generate a query object from the arrays of output parameters which Oracle stored
procedures can generate. Padding is added, if necessary, on the query columns to
ensure that all columns have the same number of rows.
Example
<!--- This example shows the use of QueryAddColumn --->
<HTML>
<HEAD>
<TITLE>
QueryAddColumn Example
</TITLE>
</HEAD>
<basefont face="Arial, Helvetica" size=2>
<body bgcolor="#FFFFD5">
<BODY>
<H3>QueryAddColumn Example</H3>
<P>This example adds three columns to a query object and then populates
the columns with the contents of three arrays.</P>
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...