Gets the values of each record returned from an executed query.
A delimited list of the values of each record returned from an executed query. Each value is enclosed in single quotation marks.
Query functions, List functions
QuotedValueList(query.column [, delimiter ])
<cfscript>
myQuery = queryNew("id,name,amount","Integer,Varchar,Integer",
[
{id=1,name="One",amount=15},
{id=2,name="Two",amount=18},
{id=3,name="Three",amount=32},
{id=4,name="Four",amount=53}
]);
// add columns
QueryAddColumn(myQuery,"city","Varchar",["London","Madrid","Paris","Munich"])
// QuotedValueList
myList=QuotedValueList(myQuery.city,"|")
writeOutput(myList)
</cfscript>
Output
'London'|'Madrid'|'Paris'|'Munich'
<cfquery name = "GetCourseList" datasource = "cfdocexamples">
select * from APP.COURSELIST where DEPT_ID in ('BIOL','MATH')
</cfquery>
<cfscript>
myList=QuotedValueList(GetCourseList.CORNUMBER," | ");
WriteDump(myList);
</cfscript>
Output
'100' | '500' | '800' | '510' | '820' | '100' | '500' | '800'
Sign in to your account