Hi-
I need to replicate records from an Oracle table to a SQL Server table. I have the replication working with the following critera on the source OCI stage "WHERE fiscal_year = TO_CHAR (SYSDATE, 'YYYY')". Here's the issue, when the calendar year changes, there may not be any data in the table I'm replicating from until the company closes the books on the prior fiscal year. If this is the case, I need to continue to replicate from the table, but the the criteria needs to be for the prior fiscal year. Our fiscal year runs concurrent with the calendar year.
Example, when the calendar years switches from 2008 to 2009, if the query using the criteria above returns no data, then pull the data from the prior fiscal year.
Questions:
1. How do I tell if the OCI stages query has returned no rows?
2. How do I implement this type of conditional logic in DataStage?
As always, any assistance is greatly appreciated!
Conditional Replication
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use a server job (since there's only one row) - the overheads are much smaller. Put the returned count into that job's user status area (search the forum for techniques), and retrieve it as the $UserStatus activity variable from the Job activity that ran that job.
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.