Page 1 of 1

How to send an e-mail notification after 5 rows are rejected

Posted: Tue Oct 18, 2005 1:21 pm
by robbie
Hi all,
I have to implement a logic where in i will have to abort after 5 rows are rejected while i load into a target table. Can any one please help me out.
Thanks in Advance

Posted: Tue Oct 18, 2005 1:35 pm
by logic
If the rows are being rejected with a warning. modify settings of job to abort after 5 warnings. Use notification activity in sequence with exception handler.
Hope this helps :)

Posted: Tue Oct 18, 2005 5:05 pm
by ray.wurlod
This is effected in the same grid where you enter your output link constraint expressions in a Transformer stage. The fourth (rightmost) column in the grid is labelled "Abort After Rows". Put 5 against your rejects link. That's all you have to do to get the job to abort.

In its controlling job sequence you need to detect that condition (a Failure trigger), send your email and, ideally, run the job again with the run type "reset".

Use DSSendMail routine

Posted: Tue Oct 18, 2005 10:55 pm
by Rangs
I have done this..

D/S has a built in routine called DSSendMail. You can call this from the Derivation or constraints inside the transformer.

Eg From Derivation

If @OUTROWNUM > 5 Then DSSendMail(StageVar) Else InputLink.MappingCol

StageVar is /n seperated parameters consisting of your exchange server name, target user, originator etc. This is available in the DSSendMail Routine's Long Description

The output link can go to a dummy nul stage or a temporary hash file

Regards
Rangs