Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 19 Jan 2016 @ 00:04:29 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023