Getting Table names and COlumns names from a Query (Reverse Engineering)

Database
Fan

Getting Table names and COlumns names from a Query (Reverse Engineering)

Hi All,

I have Queries in teradata, from which I need to reverse engineer and get the table names and column names. To explain more, please consider the following example:

Query

SELECT NAME, AGE, DEPT FROM EMPLOYEE EMP, DEPARTMENT DEP WHERE EMP.EMPID=DEP.EMPID

What I need is if there is any tool available, where in, if I paste the above query, I should get the output as given below:

TABLE NAME(S)              COLUMN NAME(S)
~~~~~~~~~~              ~~~~~~~~~~~~~~

EMPLOYEE                            NAME
EMPLOYEE                            AGE
DEPARTMENT                       DEPT

If there is no tool available as such to get the above result, can anyone suggest some work around to get the above done?

Thanks in advance.

Regards,

Vinod K
1 REPLY
Enthusiast

Re: Getting Table names and COlumns names from a Query (Reverse Engineering)

Hi,

I am not sure about the tool.

But to fetch the columns from the query you can built a view on that query and fetch the column name from dbc.columns. Other than that i don't think any help we can get from dbc tables.

~Vinod