sqloracle-databasecsvsqlplus

How do I spool to a CSV formatted file using SQLPLUS?


I want to extract some queries to a CSV output format. Unfortunately, I can't use any fancy SQL client or any language to do it. I must use SQLPLUS.

How do I do it?


Solution

  • If you are using 12.2, you can simply say

    set markup csv on
    spool myfile.csv