Description

Gets the values of each record returned from an executed query.

Returns

A delimited list of the values of each record returned from an executed query. Each value is enclosed in single quotation marks.

Category

Query functionsList functions

Function syntax

QuotedValueList(query.column [, delimiter ])

See also

ValueList

Parameters

Parameter

Description

query.column

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

delimiter

A string or a variable that contains one. Character(s) that separate column data.

Example 1

<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'

Example 2

<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'

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy