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

猜你喜欢

转载自www.cnblogs.com/hxlasky/p/10273248.html