UDF for calling Email sending program
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


UDF for calling Email sending program Expand / Collapse
Author
Message
Posted 3/10/2008 11:29:47 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 6/10/2008 10:11:16 AM
Posts: 5, Visits: 21
Hello there,
I am looking for a custom UDF which would have the following signature:
Input:
1. From Email addr. 2.To Email addr(s) 3. Subject line 4. Body Text
Output:
Status code

This is to use the UDF to send emails.
Do we have something readily available for this ?


Thanks in advance


Post #10864
Posted 3/10/2008 6:39:32 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/21/2008 10:45:25 PM
Posts: 79, Visits: 98
There is a sample external procedure for Teradata running on UNIX (MPRAS, Linux) for sending email in the user documentation. See “SQL Reference, UDF, UDM, and External Stored Procedure Programming”, release V2R6.1 (and later). See appendix C. This is the prototype:

REPLACE PROCEDURE tdmail(
in From_ VARCHAR(100),
in To_ VARCHAR(100),
in Subject VARCHAR(200),
in Message VARCHAR(32000))
LANGUAGE C
NO SQL
PARAMETER STYLE SQL
EXTERNAL name 'CS!tdmail!tdmail.c'
EXTERNAL SECURITY DEFINER;

You probably don’t want to set it up as a UDF, because you could end up sending the same email hundreds of times unintentionally, depending on the SQL statement you invoke the UDF in. Remember the database runs SQL in parallel, including UDFs, i.e., many instances at once. Of course if you set it up to send email for different rows for a table it would work, but you would probably make your UNIX system administrator very unhappy because it could overrun their email system very quickly, spam comes to mind.

Post #10870
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 1 ( 1 guest, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 9:17pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.141. 10 queries. Compression Disabled.