Ok this is what I'm trying to do. Let's say I have several views each view can have aliases and such like that and each view goes back to either another or view or a table. What I want to do is trace a specific field from it's view all the way down to the source. For example if I have this sql statement:
replace view blah
Select
t.acct_nmbr as I_account,
sum (t.num1+p.location) as location,
from blahTable as t
left outer join blahTable2 p
on t.acct_nmbr=p.acct_nmbr;
This is a very simple case but what I want it is if I say trace(i_account) I will get the following hierarchy:
I_account --> blahTable ---> acct_nmbr
Or if I want location I would get the following:
location --> sum (t.num1+p.location)-->blahTable --> num1
------------------------------------------------>blahTable2 --> location
You can see that adding more and more it can get complicated to trace this especially if there is multiple joins and select and derived tables as well. I'm currently trying to code this from scratch but I wasn't sure if there was something out there already that does this.