Hi,
We have a requirement in our project where we need to abort a job When the rowcount of the source table is zero.
could you please let us know how to check the table source count in transformer stage and based on that condition aborting a job?
Thanks
Sue
Abort if the source table has zero records
Moderators: chulett, rschirm, roy
The short answer is that you cannot check the row count for 0 in the transform stage, as processing doesn't go there.
There are several methods commonly used to do this, but this depends upon the nature and type of your source data. With database tables as sources, an external "SELECT COUNT(*)" call is often used, either in the before-job processing or in the calling job sequence.
I would prefer to call the job from a sequence, and after the job finishes I would use the DSGetJobInfo() calls to see how many rows came from the source and then trigger an abort from the job sequence if the value is 0.
There are several methods commonly used to do this, but this depends upon the nature and type of your source data. With database tables as sources, an external "SELECT COUNT(*)" call is often used, either in the before-job processing or in the calling job sequence.
I would prefer to call the job from a sequence, and after the job finishes I would use the DSGetJobInfo() calls to see how many rows came from the source and then trigger an abort from the job sequence if the value is 0.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I would follow Arnd's logic, but avoid aborting (because I always do). If the count is zero, it should suffice to log a message, maybe send an email, and then simply not execute the remainder of the sequence. Maintain control!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.