Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello All, The following routine

Status
Not open for further replies.

tekpr00

IS-IT--Management
Jan 22, 2008
186
CA
Hello All,

The following routine is to Check the input file:
if empty die and send error. OR
if contains ORA-error die and send error. OR
if empty die and send "no mismatch in tables" message.

Please Help suggest how to achieve the last option

Code:
lstoftables=`cat  rowcount_sfgm_gtxs.txt`
ora_error=`more rowcount_sfgm_gtxs.txt | grep 'ORA-'`
#change rowcount_xxxx_xxxx_txt
if [ `ls -l rowcount_sfgm_gtxs.txt | awk '{print $5}'` -eq 0 ] || [ -n "$ora_error" ] || [ ! -f "$lstoftables" ];
then
#change and add emails for 
mailx -s "Comparing the tables in Shareplex SFGM_GTXS Environment produces no mismatch."  XXXXXXX.com << END
 However, please fix the errors below if there is any.

$lstoftables
END
rm /orahome/app/oracle/home/shareplex_scripts/rowcount_sfgm_gtxs.txt
exit 1
else
 
Please confirm that you want options 1 and 3 to both occur if the file is empty. As written with the OR logic, option 3 would never occur.

Also, do you want the message "no mismatch in tables" to be sent to the logfile? to another user? to a file? via mail?

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


 
Yes, I want all the options to occur. That is:
If file does not have list of tables(empty), send message om the body of email, "Though there was compare, but there is no mismatch".
If contains ORA-error die and send error, die and send message in the body of email, "Though there was compare, however, following ORA error occurs. Please fix errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top