I have a job that extracts from certain table based on the current date and loads it on to a table.
sample:
select A.aaa,A.bbb from table A
where current date = date(send_dttm) + 2 days;
Last night my job started at 23.45 pm and finished at 00.15 this morning.
I have checked my extraction and loading and as expected it has been done using the current date as yesterday(2008-01-23).
Will there be a possibility that the current date will be used as 2008-01-24 when the extraction goes over to the next day ??
Question on Extraction
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That would depend entirely on how you specify "current date" and how the database server handles that. For example, if you specify it as "job start date" then there's no way it can carry over.
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.
The current Date is specified as I had given in the sample above.ray.wurlod wrote:That would depend entirely on how you specify "current date" and how the database server handles that. For example, if you specify it as "job start date" then there's no way it can carry over. ...
So in the DB2 stage SQL portion how do I replace the current date with the DSJobstartDate ??
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create a job parameter called, say, jpRunDate. Assign its value from a job sequence that generates the appropriate value, whether from a function, a macro, or whatever. Use a reference to this parameter instead of current date in your WHERE clause.
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.
"Goes over to the next day"?
Current date is current date and simply running over midnight doesn't change the value of the 'current date' when the the query started, which is when it would be evaluated. Of course, if you start after midnight, then of course it will use the 'next' date.
![Confused :?](./images/smilies/icon_confused.gif)
Current date is current date and simply running over midnight doesn't change the value of the 'current date' when the the query started, which is when it would be evaluated. Of course, if you start after midnight, then of course it will use the 'next' date.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers