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?
I use this command for scripts which extracts data for dimensional tables (DW). So, I use the following syntax:
set colsep '|'
set echo off
set feedback off
set linesize 1000
set pagesize 0
set sqlprompt ''
set trimspool on
set headsep off
spool output.dat
select '|', .*, '|'
from
where
spool off
And works. I don't use sed for format the output file.
- 热议问题