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

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

    You could use csv hint. See the following example:

    select /*csv*/ table_name, tablespace_name
    from all_tables
    where owner = 'SYS'
    and tablespace_name is not null;
    

提交回复
热议问题