0

I am able to generate a csv file in SQL Developer using the "set sqlformat csv" and alternatively using /csv/ in my query and spool off the results to a file. This works fine.

I now wanted to create a generic procedure to generate the csv from an Oracle package/procedure using a passed SQL query. Is it possible to use "set sqlformat csv" in this case? I know I can use the UTL_FILE utility to write the file but the missing part is the automatic CSV formatting. Thank in advance for your insight.

Joey
  • 1
  • No, that is a sqlplus command. See this https://mikesmithers.wordpress.com/2020/02/13/generating-csv-files-from-pl-sql-the-very-easy-way/ – OldProgrammer Oct 21 '22 at 20:19
  • 1
    Does this answer your question? [To generate >CSV file and automate send an email using Oracle PLSQL](https://stackoverflow.com/questions/72183649/to-generate-csv-file-and-automate-send-an-email-using-oracle-plsql). Or [Oracle how to export query to a text/csv file](https://stackoverflow.com/questions/857744/oracle-how-to-export-query-to-a-text-csv-file) – astentx Oct 21 '22 at 20:24
  • Thanks for the feedback. The APEX solution looks good but it is currently not in our environment. Leaning towards the solutions discussed on Mike's blog. Thanks again. – Joey Oct 24 '22 at 13:14

0 Answers0