We have a requirement to send email to set of users on successful execution of a Teradata procedure. Is there a way to send email from Teradata procedure or any other way to achieve this functionality. Procedure is getting called from Java. We prefer to send email frome either Teradata directly or from UNIX box. But not sure procedure can call a UNIX shell file.
If you are running on Linux/ Unix, you can call your stored procedure from bteq, then use the .OS command to send the messages. If you want to add some sort of details from the database, your stored procedure would have to create the details in a table; then use bteq export to send these to a file. The file can be the body of the email which is then sent to the mail command on Unix/ Linux. In this case the export and mail must be in bteq after calling the proc. As the commands come from bteq on your home server (the server you sign onto to run scripts), not from a database node, it works fine.
If you are using Windows, you would need to use something like C++ and the mapi interface to create messages. It is very messy though! I have never used it on mainframes. The ".OS mail" command will not run on mainframes, but there is similar functionality if you really need it.