Recursive Query to List down the Lineage for a Particular Table with Immediate Parents

Database

Recursive Query to List down the Lineage for a Particular Table with Immediate Parents

Hi All 

I have require to list down the lineage for a particular table as below:

Source --> Target1

Target1 --> Target2

Target1 --> Target 3

Target2 --> Target 4

Here the target become the source and so on. I used a recursive query but it is not giving me immediate parent but the source parent and data looks as below :

Source --> Target1

Source --> Target2

Source --> Target 3

Source --> Target 4


As we all know that there can be multiple views on  a table , and then each of these views can be exposed in deifferent application via some new views on top of them .

I am trying to list it .

If anyone has already implemented this , Please share your inputs.

Regards

Himanshu

Tags (1)
1 REPLY
Junior Contributor

Re: Recursive Query to List down the Lineage for a Particular Table with Immediate Parents

Hi Himanshu,

you probably use the wrong column in your recursive part, old.source instead of new.source.