Generate CSV from SQL*Plus


Just a short post. How to quickly output to CSV when using SQL*Plus with Oracle. Save the following to a file export_to_csv.sql: Afterwards, log in to SQL*Plus and run using the command: