The other day I needed to generate some .csv files and was surprised there was no straightforward way of doing that. I know sqlcl has the select /*csv*/ feature, but I was trying to automate this. The apex_data_export package requires APEX and I was on an older version that predates that package anyway. So I wrote a quick package that takes a SQL query and generates CSV data as a CLOB.
CSV_BUILDER is available on GitHub.