Hi All,
In my Source table has start date and end date and data's are like I mentioned below
Start Date End Date
08-11-2012 13-11-2012
Expected result would be
08-11-2012
09-11-2012
10-11-2012
11-11-2012
12-11-2012
13-11-2012
I have to pivot the start date till the end date. I know this logic would be done through loop concept but I have very limited knowledge on this.
Any help would be appreciated.
Pivot Date...
Moderators: chulett, rschirm, roy
Pivot Date...
prabakaran.v
If my source datbase was Oracle 9i or above, I would most certainly use this SQL than do this in datastage transformer loop var
Example here that works on any Oracle DB after 10g -
substitute your tables columns query instead of inner query .
Example here that works on any Oracle DB after 10g -
substitute your tables columns query instead of inner query .
Code: Select all
SELECT ROWNUM, START_DATE+ROWNUM-1, END_DATE FROM
(select sysdate AS START_DATE,sysdate+7 AS END_DATE from dual )
CONNECT BY ROWNUM <= ABS(END_DATE-START_DATE)+1
Hi praburaj,
Although I do not have datastage in front of me as of now, you can try the below-
In Stage Variable-
In Loop condition-
In Loopvariable
Output Derivation-
LV1 OutputCol
Although I do not have datastage in front of me as of now, you can try the below-
In Stage Variable-
Code: Select all
juliandayfromdate(EndDate)-JulianDayfromdate(StartDate) SV1
Code: Select all
@iteration<=SV1+1
Code: Select all
if @iteration=1 then StartDate else
DateFromJulianDay(JulianDayfromdate(StartDate)+(@iteration-1)) LV1
Output Derivation-
LV1 OutputCol