Hi,
I have a data like;
100:200
200:300
300:400
500:600
600:700
900:1000
1000:1100
Input data shows that 200 is linked to 100, 300 is linked to 200 and also 200 is linked to 100 so 300 is linked to 100. similarly, 400 is also linked to 100 because 300 is linked to 200 and 200 is linked to 100.
And the required output is:
200:100
300:100
400:100
600:500
700:500
1000:900
1100:900
Can i use recursive lookup to achieve this and if yes, then how?
Thanks in Advance.
Atul
Recursive lookups
Moderators: chulett, rschirm, roy
DataStage does not have a capacity for recursive lookups the way you explained. It is possible to have several consecutive lookups to the same source located after each other in order to emulate this functionality but you would need to put sufficient lookups to guarantee that you would find the "root".
Depending upon where your source data is stored (i.e. in a database), you might be able to resolve the lookups using an appropriate SQL query.
Depending upon where your source data is stored (i.e. in a database), you might be able to resolve the lookups using an appropriate SQL query.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Is that only the structure you need or do you have more attributes to work with?
You can do that by running through the data 2 times.
First time you can load the data - as it is - into a table.
Second time you can use it as a lookup with flattened data (using something like level of Oracle) to locate the root node.
You can do that by running through the data 2 times.
First time you can load the data - as it is - into a table.
Second time you can use it as a lookup with flattened data (using something like level of Oracle) to locate the root node.
-
- Premium Member
- Posts: 892
- Joined: Thu Oct 16, 2003 5:18 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: