Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 08 Apr 2010 @ 21:07:40 GMT


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


Subj:   Re: Finding data types in views
 
From:   Pradip.Bhogal

You can use following SQL to generate Select statements and Export result set to excel file using those statements.

     SEL
         'SEL   '||
         ''''||DATABASENAME||''''||','||''''||TABLENAME||''''||','||''''||COLUMNNAME|
         |''''||','||' TYPE('||TRIM(COLUMNNAME)||')'||'
           '||'FROM  '||TRIM(DATABASENAME)||'.'||TRIM(TABLENAME)||' SAMPLE 1;'
         (VARCHAR(200))

     FROM
         ( SEL A.DATABASENAME ,A.TABLENAME ,A.COLUMNNAME FROM DBC.COLUMNS A ,DBC.TABLES  B

           WHERE A.DATABASENAME = B.DATABASENAME
           AND A.TABLENAME = B.TABLENAME
           AND A.DATABASENAME = 'DATABASENAME'
           AND TABLEKIND ='V'
         ) A

     ORDER BY 1

-Pradip Singh



     
  <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