Hi,
How to send output of Query Result in the email body using datastage.
Example: I write the output of a query in a text file. Then content of text file or directly output of query, I want to send in Email Body
Thanks
Atul
Query result in Email Body
Moderators: chulett, rschirm, roy
Unless something has changed in the newer versions (and it looks like it hasn't) the Notification Activity stage only supports files as attachments. However, that doesn't mean you can't do a couple of other things to get the results you want.
1) Write your own custom version of the existing DSSendMail routine and add that functionality, then use that routine to send email from a Sequence job rather than using the Notification Activity stage.
2) Write a script to send mail from the server using whatever mail software you have installed (sendmail, mailx, whatever) and build in that ability, then leverage the script via the Execute Command stage in a Sequence job or 'After Job' or wherever you like.
Both would take the filename containing the text to inline / inject into the email body as a parameter / argument.
1) Write your own custom version of the existing DSSendMail routine and add that functionality, then use that routine to send email from a Sequence job rather than using the Notification Activity stage.
2) Write a script to send mail from the server using whatever mail software you have installed (sendmail, mailx, whatever) and build in that ability, then leverage the script via the Execute Command stage in a Sequence job or 'After Job' or wherever you like.
Both would take the filename containing the text to inline / inject into the email body as a parameter / argument.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I tried below in DSSendMail routine. Its sending email, but its not sending the content of file in email body
"From:atul@xxxxxx.com\nTo:atul@xxxxxx.com\nSubject:Hi ya\nAttach:/app/bb5g_etl/ATUL/email.txt\nBody:\n Execute_Command_1.$CommandOutput"
"From:atul@xxxxxx.com\nTo:atul@xxxxxx.com\nSubject:Hi ya\nAttach:/app/bb5g_etl/ATUL/email.txt\nBody:\n Execute_Command_1.$CommandOutput"
Atul