Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 23 Jun 2009 @ 07:24:30 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Emailing based on table activity
 
From:   McCall, Glenn David

  Is it possible for me to fire an email for any activity into a teradata table (Insertion specifically). For eg: whenever any row is inserted into tablex , an email should be sent to a group of people having specific columns of the table x.  


There is no in built facility to do this, but assuming you really need to do it and the volumes are relatively low, you could do this with:

a) a Trigger and an XSP or

b) a Trigger, Queue table and an external program.


In both case, the trigger fires when a row is inserted into your target table.

In scenario a) The trigger calls the XSP. An XSP can do pretty much anything (within reason). Your XSP could call a mail API to generate the email(s).

In scenario b) The trigger inserts data into the queue table. An external program is continually running a select and consume query on the queue table. If there are no rows in the queue table, the external program simply is blocked. When a row is present in the table, the select will return. The external program could then generate the email, again using a Mail API. I've used this approach for a couple of different purpose (not generating email) and it worked quite well.

If memory serves Triggers calling XSP's is only a fairly recent addition to TD (maybe TD 12 or V2R6.2) so your ability to do this will be based upon the version of TD you are running. The Queue table approach should work with earlier version of Teradata (e.g. at least V2R6.1 and later).

Obviously you would only want to do something like this where an insert into the table is a very exceptional circumstance otherwise people will be bombarded with emails about rows being loaded.


Teradata Corporation
Glenn McCall
Canberra Australia



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023