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

后端 未结 16 1234
执笔经年
执笔经年 2020-11-22 15:40

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?

16条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 16:18

    I know this is an old thread, however I noticed that no one mentioned the underline option, which can remove the underlines under the column headings.

    set pagesize 50000--50k is the max as of 12c
    set linesize 10000   
    set trimspool on  --remove trailing blankspaces
    set underline off --remove the dashes/underlines under the col headers
    set colsep ~
    
    select * from DW_TMC_PROJECT_VW;
    

提交回复
热议问题