Description

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

Returns

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

Category

List functionsQuery functions

Function syntax

ValueList(queryColumn [, delimiter ])

History

ColdFusion (2018 release): Introduced named parameters.

See also

QuotedValueList

Parameters

Parameter

Description

queryColumn

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. The default value is comma (,).

Example

<cfscript>
    myQuery=queryNew("id,title", "integer,varchar",
    [ {"id":1,"title":"Iron Maiden"}, 
      {"id":2,"title":"Judas Priest"},
      {"id":3,"title":"Black Sabbath"},
      {"id":4,"title":"Deep Purple"},
      {"id":5,"title":"Rolling Stones"}
    ]);
    valueListTitle=ValueList(myQuery.title)
    writeOutput(valueListTitle)
</cfscript>

Output

Iron Maiden,Judas Priest,Black Sabbath,Deep Purple,Rolling Stones

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