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

后端 未结 16 1224
执笔经年
执笔经年 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:23

    I wrote this purely SQLPlus script to dump tables to CSV in 1994.

    As noted in the script comments, someone at Oracle put my script in an Oracle Support note, but without attribution.

    https://github.com/jkstill/oracle-script-lib/blob/master/sql/dump.sql

    The script also also builds a control file and a parameter file for SQL*LOADER

提交回复
热议问题