投稿‎ > ‎

cat sel.sh

posted Oct 29, 2018, 1:24 AM by Zhang Wenxu   [ updated Oct 29, 2018, 2:10 AM ]
cat sel.sh
sqlplus -s username/password@oracle<<EOF > /dev/null
set heading off
set echo off
set lines 10000
set pages 0
set feedback off
set colsep '","'
set tab off
set trims on
set trim on
ALTER SESSION SET NLS_DATE_FORMAT='yyyy/mm/dd hh24:mi:ss';
spool regist.txt
select * from regist order by pan;
spool off
EOF
sed -i 's/ *",/",/g' regist.txt
sed -i 's/^/"/g' regist.txt
sed -i 's/$/"/g' regist.txt
Comments