::: DATABASE :::/└ ::: ORACLE :::

sqlplus query

호딩이 2011. 12. 20. 15:53
#!/bin/sh
export ORACLE_HOME=/home/oracle/app/oracle/product/11.1.0/client_1
export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export ORACLE_SID=
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib

/home/oracle/app/oracle/product/11.1.0/client_1/bin/sqlplus id/pw@DB < /root/sms/sms.sql

for i in 010xxxxxxx
do
echo "Insert into em_tran (tran_pr, tran_phone, tran_callback, tran_status, tran_date, tran_msg ) values(em_tran_pr.nextval, '$i', '02-xxxx-xxxx', '1', sysdate, '$1');" >> /root/sms/server2.dat
done

echo "commit;" >> /root/sms/server2.dat