# Read the files from ccdbcen directory:
for strFileName in `ls -trp CCDB* 2> /dev/null`
if [[ $SkipInd != "Y" ]]
echo "File Name: $strFileName<br>" >$LOGFILE.$strFileName
echo "File Name: $strFileName"
while [[ $MIN_LOOP_COUNT -le $MAX_LOOP_COUNT ]]
$ORACLE_HOME/bin/sqlplus -s >>$LOGFILE.$strFileName<< EOF
set serveroutput on;
whenever sqlerror exit 1;
whenever oserror exit 1;
-- Load the file into a work table and process
ERROR_CDE=`egrep $TRAP_CODES $LOGFILE.$strFileName | sed 's/:.*//'`
echo "\nTHE ERROR CODE IS $ERROR_CDE"
if [[ $ERROR_CDE = "" ]]
THE ERROR CODE IS ORA-06512
There is no indenting of your code so the program is extremely difficult to read.
The variable SkipInd is not set so I'm unsure why you don't get an error here.
There are no echo's within the loops so it's difficult to see where, why or if it's actually looping.
Shouldn't there be a delay between attempts at loading the data?
I looked up the error codes and they seem to indicate PLSQL errors - shouldn't these be fixed first? why are you expecting these errors to go after attempting to reload the data?
The variable ERROR_CDE contains all the occurrences of the trapped codes - if there were 1000's of errors thrown while loading the data then it will contain 1000's of ORA-xxxx values - are you sure these aren't what are being printed out?
Have you invested in that book on Unix shell programming yet?