Page 1 of 1

Send email for 0 rows in link

Posted: Thu Dec 20, 2007 11:11 am
by shrey3a
Hi,

Our requirement is to send the email to users if the file is empty i.e. there are no rows processed, we want to implement the logic in ETL only.

I used the below logic in stage variable, constraint and even column transformation but it only runs if if there are actually rows processed i.e. @INROWNUM = 1 or > 1 for =0 it do nothing

IF @INROWNUM = 0 THEN DSSendMailTester('a@yahoo.com', 'a@yahoo.com', 'ul', 'a.com', 'Zero') else 0

Please guide if there is anyother way of doing it.

Regards,
Munish

Posted: Thu Dec 20, 2007 11:20 am
by chulett
You need to check the link count after the fact in a separate process. This would typically be done in a Sequence job - a Routine Activity stage to do the DSGetLinkInfo and then triggers to send a zero result to a Notification Activity stage.

Posted: Thu Dec 20, 2007 11:22 am
by sunil_acc
why dont you try creating a befor job subroutine.
code tthe subroutine to check the size of the file, if the size is zero then send mail, and use it as a befor job subroutine in your job!

thanks
sunil

Posted: Thu Dec 20, 2007 11:22 am
by sunil_acc
why dont you try creating a befor job subroutine.
code tthe subroutine to check the size of the file, if the size is zero then send mail, and use it as a befor job subroutine in your job!

thanks
sunil

Posted: Thu Dec 20, 2007 2:53 pm
by ray.wurlod
To use an after-stage subroutine, rather than a before-job subroutine, would make more sense.

I would use a separate activity, or even two, in a job sequence to detect the zero row count and to send the email. These would, of course, be executed after the job in question, though possibly in the same job sequence.