导出数据库数据成txt格式

set verify off;

set colsep ‘分隔符’;

set echo off;

set feedback off;

set heading off;

set pagesize 0;

set linesize 10000;

set numwidth 26;

set termout off;

set trimout on;

set trimspool on;

spool ‘/etl/a.txt’

select 

trim(字段)||’分割符’||

trim(字段)||’分割符’||

trim(字段)

from a

where date between ‘&1’ and ‘&2’;

spool off;

 

最后一个字段无分隔符,不然不能装载数据

 set verify off;有变量。无变量可省略

posted @ 2019-04-30 10:06  菜鸟MM  阅读(1115)  评论(0编辑  收藏  举报