Archives of the TeradataForum
Message Posted: Mon, 19 Jan 2016 @ 00:04:29 GMT
Subj: | | Re: How to identify aliased columns in a view |
|
From: | | Clark, Dave |
Nazy- As suggested in another response, if you are only looking for the actual column name and you do not know the name of the source
table, you will have to obtain the column names by parsing the RequestText of the view. I was referring to a method to obtain the metadata such
as COLUMNTYPE. For example, you can specify something like:
CREATE TABLE SALES.EMP2 AS (SELECT * FROM SALES.EMP_VIEW) WITH NO DATA;
Given this, you can query DBC.COLUMNS:
sel columntype from dbc.columns
where databasename='sales'and tablename='emp2' and ColumnName='empno';
Unfortunately, this will not help with the actual column name. In the example provided, "empno" is the view columname.
-dave.clark
|