![MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference Download Page 511](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-cfml-language/coldfusion-4-5-cfml-language_reference_3287257511.webp)
Chapter 2: ColdFusion Functions
487
QuotedValueList
Returns a comma-separated list of the values of each record returned from a
previously executed query. Each value in the list is enclosed in single quotes.
See also
ValueList
.
Syntax
QuotedValueList
(
query.column [, delimiter ])
query.column
Name of an already executed query and column. Separate query name and
column name with a period ( . ).
delimiter
A string delimiter to separate column data.
Example
<!--- This example shows the use of QuotedValueList --->
<HTML>
<HEAD>
<TITLE>
QuotedValueList Example
</TITLE>
</HEAD>
<BODY>
<H3>QuotedValueList Example</H3>
<!--- use the contents of one query to create another
dynamically --->
<CFSET List = "‘BIOL’, ‘CHEM’">
<!--- first, get the department ids in our list --->
<CFQUERY NAME="GetDepartments" DATASOURCE="cfsnippets">
SELECT Dept_ID FROM Departments
WHERE Dept_ID IN (#PreserveSingleQuotes(List)#)
</CFQUERY>
<!--- now, select the courses for that department based
on the quotedValueList produced from our previous query --->
<CFQUERY NAME="GetCourseList" DATASOURCE="cfsnippets">
SELECT *
FROM CourseList
WHERE Dept_ID IN (#QuotedValueList(GetDepartments.Dept_ID)#)
</CFQUERY>
<!--- now, output the results --->
<CFOUTPUT QUERY="GetCourseList" >
<PRE>#Course_ID##Dept_ID##CorNumber##CorName#</PRE>
</CFOUTPUT>
</BODY>
</HTML>
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...