getting Hierarchical data

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sandeepch19
Participant
Posts: 36
Joined: Fri May 21, 2010 12:40 am
Location: Bangalore

getting Hierarchical data

Post by Sandeepch19 »

Hi,
I wanted to know , how we can implement the job to retrieve the hierarchical data. The exampale would is as below

lets say we have a table a and three columns id1,name,id2. I need to get the all the parents of id1. for ex: if i have the below values in id1 and id2 field
id1 id2
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10


i need to get all the 10 records in the output
Sandeep Chandrashekar
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What database? For Oracle, you have CONNECT BY and I imagine other products have something similar.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sandeepch19
Participant
Posts: 36
Joined: Fri May 21, 2010 12:40 am
Location: Bangalore

retreiving hierarchy data using datastage

Post by Sandeepch19 »

yes it is oracle, but my question is whether we can implement this using datastage or not.
Sandeep Chandrashekar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Not in a single pass.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can certainly implement the SQL in DataStage. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Otherwise, perhaps the judicious use of a hashed file would work or perhaps a lookup with multi-row result set enabled. It's hard for me to tell from your example since all of the numbers run sequentially. Those "10 records" you need in your output come from how many input records - 1? 10?

Spell out for us in words the process each input row must go through to generate the proper output(s).
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply