OpenBD Wiki

From OpenBD
Jump to: navigation, search

ToCSV()

This function performs a very highly efficient conversion of a Query object to a CSV string, delimited by whatever token you wish.

Contents

Parameters

ToCSV( query [, delimitor ] )

  • query: this is main query object
  • delimitor: this is delimitor for the records, defaults to comma (,). You can specify the word "TAB" for tabs delimited.

Returns

This function returns back the query as a CSV string/

Example

<cfset csv    = ToCSV( myQry )>
<cfset csvTab = ToCSV( myQry, "TAB" )>

Notes

This function does not touch the underlying query object. It will output the rows in the order to which they appear in the query object. The first row of the CSV output will contain the column names. Any strings will be enclosed with quotes (") and if a string contains a quote, it will be double quoted.

Engine Compatibility

  • OpenBD
  • BlueDragon

Personal tools