This is the block of code inside the other file
sqlplus -s <<EOF 2>&1 > $<filename>.txt
$uid/$pwd
SET SERVEROUTPUT ON
SET HEAD OFF
SET FEEDBACK OFF
WHENEVER SQLERROR EXIT.SQLCODE
BEGIN
DBMS_OUTPUT.ENABLE(30000)
COMMIT;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Change the error message');
DBMS_OUTPUT.PUT_LINE(SQLCODE||'-'||SQLERRM);
ROLLBACK;
RAISE;
END;
/
EXIT;
EOF
plsqlerror=$?
if [ $plsqlerror -ne 0 ]
then
echo "change the error message"
TITLE="${HOST}==>ABEND==> Change the error message "
print "${ENVR}==>${PROG_NAME}==> Change the error message " >>
${LOG_FILE}
print "ABEND ==>${TITLE}" >> ${LOG_FILE}
Mail -s "${TITLE}" ${<Give appropriate mailing list>} < ${LOG_FILE}
Mail -s "${TITLE}" ${<Give appropriate mailing list>} < ${LOG_FILE}
exit 1
fi