...
...
2) Will the part of your query in red return only one record? -- no , more than one record is also possible.
- If it returns 4 records and 2 of them have counts_matching = "Yes" and the other 2 have counts_matching = "No", then what should be the final value of counts_matching?
--> in this case if all the counts_matching records = 'Yes' then subject line should be as "load counts Match for 'yyyymmdd' "
else if any of the counts_matching records = 'No' then subject line should be as ""warning : load_count mismatch for 'yyyymmdd'" but report should contain all the counts_matching records.
So, in order to determine the appropriate mail subject, you want to find out if all records had counts matching or not.
The following query returns 1 if all records inserted today in table t1 have identical values for table_row_count and input_record_cnt.
If at least one record has different values, then the query returns 0.
Of course, I assume that all both these columns (table_row_count and input_record_cnt) have numeric datatype, integer values and are non-nullable.
If NULLs are involved, then things become complicated pretty quickly.
- If one value is NULL and the other is, say, 5 then is that a mismatch or do you want to exclude them from comparison altogether, since NULL means "absence of value"?
- If both values are NULLs then is that a match or a mismatch?
Oracle has a lot of quirks regarding NULLs and I've avoided them in my suggested query.
Once you have this query, you can spool its output to another file and then read the said file to determine your mail subject.
Here's the shell script.
Note that I am echoing the mail command instead of executing it since I cannot email from my system.
I want to send email for every row comes out of following SQL statement
thank you for your help.
*****SQL STATEMENT******
Select SCUSER AS "USER IDS" , SCEUSER AS "LOCKED OUT" FROM SYS.7333.F98OWSEC;
*******OUPUT COMES LIKE THIS AND ONE EMAIL COMES AS PER SCRIPT BELOW******
******BUT... (4 Replies)
Hi,
We have been trying to send mail with attachment and it is going fine, but when we try to attach a text to the body of the email, we find that the mail is going fine with the body text but the attachment is not going through. We are using ksh.
The command that is successfull without the... (6 Replies)
Hi
I want to able to attach a file to a email and send it with a body
the body of the email is within the "body" file, and the attachment in "atch"
if i send like below it will send the email correctly
/usr/sbin/sendmail me@you.com< body
And when i send the attachment alone... (3 Replies)
Hi
i have a script which executes daily through cron. The output of the script is appended to a log file everyday
It also emails me the output of the logfile as we have the mailx command in the script
The below is my requirement :
Normally When I get the email it sends the entire content... (3 Replies)
Hi,
Im having a bit of an issue with using the uuencode command and sending out an email.
My aim is to send an email out which has a body and also have attachments. Currently I can either get one or the other and not both on the same email.
uuencode... (4 Replies)
Hi ,
I have a sql query in the unix script ,whose output is shown below.I want to convert this output to HTML table format & send email from unix with this table as email body.
p_id src_system amount
1 A 100
2 B 200
3 C ... (3 Replies)
I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email.
spool table_update.html;
SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription';
spool off;
exit;
Please use code tags next time for your code and data.... (9 Replies)
Hi
I have a script running in lunix machine which emails log file content to my outlook.
Here is the actual log file result:
Image-1
In-Master:25028
ReplicaDn Consumer Supplier Delay
dc=xxx,dc=com lmjker0110:12345 ... (4 Replies)
I am making use of the following code to display the results of my txt file in an email:
mail -s 'Count Validation Test Comparison Results' Ronit@XYZ.com < Count_Validation_Results_`date +%m%d%Y`.txt
Email Output:
----------Query 1 Count Validation Results--------
Source count is 4
Target... (7 Replies)
Hello experts!!
I am trying to send an email with message body and attachment.but i am getting any one like message body or attachment.
I tried below command:
(echo "subject:test";echo "MIME-Version: 1.0";echo "content-transfer-encoding:base 64";echo "content-type:txt;name=test.txt";cat... (2 Replies)