Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 23 Oct 2001 @ 23:26:26 GMT


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


Subj:   Re: Need Cross Reference List of View to Table
 
From:   Emily Parsons

Try this........

     SELECT
     TBL.DATABASENAME (CHAR(30)),
     TBL.TABLENAME (CHAR(18)),
     VW.DATABASENAME (CHAR(30)),
     VW.TABLENAME (CHAR(18))
     FROM DBC.TABLES VW,
          DBC.TABLES TBL,
          DBC.DATABASES VDB,
          DBC.DATABASES TDB
     WHERE
     (INDEX(VW.REQUESTTEXT,
       TRIM(TBL.DATABASENAME)||'.'||TRIM(TBL.TABLENAME)||' ') > 0
     OR
     INDEX(VW.REQUESTTEXT,
       TRIM(TBL.DATABASENAME)||'.'||TRIM(TBL.TABLENAME)||',') > 0
     OR
     INDEX(VW.REQUESTTEXT,
       TRIM(TBL.DATABASENAME)||'.'||TRIM(TBL.TABLENAME)||';') > 0)
       AND VW.DATABASENAME = VDB.DATABASENAME
       AND TBL.DATABASENAME = TDB.DATABASENAME
       AND VDB.OWNERNAME = 'VIEW_GROUP'
       AND TDB.OWNERNAME = 'TABLE_GROUP' ;

VIEW_GROUP and TABLE_GROUP are the ownernames we assign to views and tables.



     
  <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