ValueList

Inserts a delimiter between each value in an executed query. ColdFusion does not evaluate the arguments.

A delimited list of the values of each record returned from an executed query.

Other functions, Query functions

ValueList(query.column [, delimiter ])

QuotedValueList

Parameter Description

query.column

Name of an executed query and column. Separate query name and column name with a period.

delimiter

A delimiter character to separate column data items. Default: comma (,).

<h3>ValueList Example</h3>

<!--- use the contents of a query to create another dynamically --->
<cfquery name = "GetDepartments" datasource = "cfsnippets">
   SELECT Dept_ID FROM Departments
   WHERE Dept_ID IN (`BIOL')
</cfquery>

<cfquery name = "GetCourseList" datasource = "cfsnippets">
SELECT *
   FROM CourseList
   WHERE Dept_ID IN (`#ValueList(GetDepartments.Dept_ID)#')
</cfquery>

<cfoutput QUERY = "GetCourseList" >
<pre>#Course_ID#   #Dept_ID#   #CorNumber#   #CorName#</pre>
</cfoutput>

View comments on LiveDocs