Deriving different Levels

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Post by Havoc »

Hi,

I thought i'd post this. I think I found a solution/workaround to the problem mentioned.
Thought we can use a user-defined insert SQL in the Oracle Stage by leveraging the LEVEL pseudocolumn in the Oracle d/b. Its pretty handy..

syntax can be found here:

http://www.psoug.org/reference/connectby.html
Havoc
Participant
Posts: 110
Joined: Fri Nov 24, 2006 8:26 am

Post by Havoc »

Can someone provide some inputs on this ? Disadvantages or otherwise with regard to this approach?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Hi Havoc,

The option that you found out is more simple. You can just group by based on Parent Dept Child Dept, and get the max(LEVEL) with order by max(LEVEL) during extraction. You can just concatenate subsequent row until you find a change in value using stage variable. Though the LEVEL is in reverse order when compared to you expectation, it is quite simple for your requirement.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply