oracle中如何在后台执行一条sql语句?是在Linux下的脚本文件中写入sql语句吗,该怎么写?
------解决思路----------------------
shell执行delete
sqlplus username/password@database << eof
whenever sqlerror exit failure rollback;
delete from ci_message_table
where program_name ='GENBISWF'
and TRUNC(date_time) = TO_DATE(sysdate,'dd-mon-yy');
commit;
eof
RETURN_CODE="$?"
if [ $RETURN_CODE != 0 ]
then
echo " abnormal termination for program gen_bis_weekly_data"
echo " return code is " $RETURN_CODE
echo "\n
***************************************
abnormal termination for job $JOBNAME
***************************************\n"
exit 1
fi