spool例子

set head off
set echo off
set feed off
set heads off
set pages 50000
SET NEWPAGE NONE
column yesterday new_value checkdate noprint;
select to_char(sysdate-1,'yyyymmdd') yesterday from dual;

spool C:\spool\spool_file\crm_&checkdate..html
select 
t.id||'|'||t.name||'|'||to_char(createtime,'YYYYMMDDHH24:MI:SS') data
from tb_hxl_test t;
spool off;

批处理run_sql.cmd内容如下

sqlplus hxl/hxl@oracl_11g @C:\spool\sql\get_sql.sql

posted @ 2019-01-15 17:41  slnngk  阅读(222)  评论(0编辑  收藏  举报