sqlplus--spool基础运用

set heading off
set feedback off
set echo off
set newp none
set termout off
spool /home/orarun/scripts/date.txt
select a.REC_CREATOR||'|'||a.REC_CREATE_TIME||'|'||b.event_name||'|'||a.ORDER_NO||'|'||a.MAT_NO||'|'||a.MAT_STATUS||'|'||a.WT from tpmof03 a,tpmof21 b where (a.event_id=b.event_id and a.event_id in('52','6A','6B','6C','6D','5B'))and (a.rec_create_time>='20120101000000');
spool off;


sh脚本
#!/bin/sh
rm /home/orarun/scripts/date.txt
sqlplus tjc1/tjc10804@tjc1 << EOF
@selecttpmof03.txt                   
EOF

猜你喜欢

转载自www.cnblogs.com/sunziying/p/8954339.html