-
-
Notifications
You must be signed in to change notification settings - Fork 40
queryToCsv
Julian Halliwell edited this page Nov 27, 2023
·
5 revisions
Deprecated: from version 3.12.0 use writeCsv() which has many more options
Convert a query to a CSV string.
queryToCsv( query[, includeHeaderRow[, delimiter[, threads ] ] ] )
-
queryquery
-
includeHeaderRowboolean default=false: whether the query columns should be included as the first row of the CSV -
delimiterstring default=",": the single delimiter used in the CSV to separate the fields. For tab delimited data, use\tortabor#Chr( 9 )#. -
threadsnumeric default=1: the number of CPU threads to run in parallel (only supported in Lucee and ColdFusion 2021+). WARNING: running 2 or more parallel threads can cause unexpected results. In particular rows are likely to be assembled out of order. System crashes are also possible so use this option with care!
Chainable? No.
data = QueryNew( "First,Last", "VarChar,VarChar", [ [ "Susi","Sorglos" ], [ "Frumpo","McNugget" ] ] );
spreadsheet = New spreadsheet();
csv = spreadsheet.queryToCsv( data );