oracle spool-to-csv

--set colsep ,
set feedback off
set heading off
set newp none
set pagesize 0
set linesize 200
set trimout on
set termout off
SPOOL dcs_file_record.csv
--select '"' ||BLOOMBERGTICKER || '","' || BLOOMBERGUNIQUEID || '","' || CALLEXECUTIONDATE || '"' from dcs_reserved_markit_instrument where check_time > trunc(sysdate)-30;
--select * from dcs_reserved_markit_instrument where check_time > trunc(sysdate)-10;
--select '' ||DCS_ID || ',' || BATCH_ID || ',' || HOST || ',' || PATH || ',' || FILE_NAME || ',' || FILE_TIME|| ',' || DCS_FLAG || ',' || CREATE_TIME || '' from dcs_file_record; 
select '' ||DCS_ID || ',' || BATCH_ID || ',' || HOST || ',' || PATH || ',' || FILE_NAME || ',' || FILE_TIME|| ',' || DCS_FLAG || ',' || to_char(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') || '' from dcs_file_record ;
SPOOL off
exit

  

posted @ 2021-07-28 16:15  rjm123456  阅读(65)  评论(0编辑  收藏  举报