shell查询数据生成文件到指定路径
程序员文章站
2022-06-10 18:09:25
...
############################### CONN_SALE=库名/密码@服务名 echo "=======================================================================" ############################### # 2.data export # ############################### #cd ${DataPath} DEALDATEDay=`date -d"-1 day" +%Y%m%d`"_1库.csv" filename=${DEALDATEDay} sqlplus -s $CONN_SALE <<EOF set echo off; set feedback off; set heading off set pagesize 0; set linesize 7000; set termout off; set trimout on; set trimspool on; spool /bss/sale1/filecenter_in/test_info/${filename} select '省份'||','||'地市'||' from dual; spool off; exit; EOF