<!--- 
 Filename: FilmsCommaSep.cfm
 Author:  Nate Weiss (NMW)
 Purpose: Outputs film information as comma-separated text
--->

<cfheader 
 name="Content-Disposition" 
 value="Attachment; filename=films.txt">

Retrieving information about films...
<cfquery datasource="ows" name="getFilms">
 SELECT FilmID, MovieTitle
 FROM Films
 ORDER BY MovieTitle
</cfquery>

<!--- Now output as simple comma-separated text --->
<!--- Put the column names on first line, then --->
<!--- the actual data rows on their own lines  --->
<cfcontent type="text/plain">"FilmID","MovieTitle"
<cfoutput query="getFilms">#FilmID#,"#MovieTitle#"
</cfoutput>
