I need to develop a dictionary or cross reference that maps view/column to table/column. I realize that a view “column” is really an expression and does not necessarily map to a table column – but in our case – they do.
They only way I can think of doing this is to process the CREATE VIEW statement through AWK and match the first column definition to the first SELECT column, etc.
Anyone out there have any suggestions or put something like this together?
This is incomplete just because I am lazy, but the following will pull a list of views based on the table name specified ni the query. You could use the results of it to match part number to column name in some fasion:
from systables where tabid in
(select dtabid from sysdepend where btabid in
(select tabid from systables where tabname = 'sometable'))