Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Hello All, The following routine

Hello All, The following routine

Hello All, The following routine

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 --> script

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" ];
#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.

rm /orahome/app/oracle/home/shareplex_scripts/rowcount_sfgm_gtxs.txt
exit 1

RE: Hello All, The following routine

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

RE: Hello All, The following routine

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."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close