I have a KSH script that runs a SQL script, then sends an email to me indicating that it's completed. I would like to modify it so that the body of the email will contain a count of the number of records Added, Changed, Deleted as a result of the SQL script.
Here's what I was trying, but it's not working...what am I doing wrong?
Code:
MESG_GOOD="Completed Successfully"
cntADD=sqlplus -s user/pwd select count(*) from tbl where...;
cntCHA=sqlplus -s user/pwd select count(*) from tbl where...;
cntDEL=sqlplus -s user/pwd select count(*) from tbl where...;
content="Adds: " && cntADD && "Changes: " && cntCHA && "Deletes: " &&cntDEL
/usr/bin/echo $content | /usr/bin/mailx -s $MESG_GOOD me@here.com