Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Mon, 21 Feb 2005 @ 14:16:08 GMT


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


Subj:   Re: Views referring tables
 
From:   Dempsey, Mike

There have been a lot of responses to this one but I though a full description might be helpful...

The best way (other than using Metadata Services) to find the references is to look at DBC.CreateText since this column contains data that has been partially parsed and is therefore consistant. (Unlike RequestText which may or may not contain qualified names, which may or may not be enclosed in double quotes.) Names in CreateText are always qualified and always enclosed in double quotes.

The SQL would be:

     SELECT DatabaseName, TVMName, TableKind AS "Type"
       FROM dbc.TVM T, dbc.dbase D
      WHERE D.DatabaseId=T.DatabaseId
        AND CreateText LIKE '%"".""%' (NOT CS)
      ORDER BY 1,2

This will find most views and macros that directly reference your table. You would then have to repeat the query for each View/Macro found in order to find indirect references.

Also, if you have any very large views (CreateText larger than 20K) you may not find these since the 'overflow' text is stored in TextTbl rather than TVM. (TextTbl is not stored in 'parsed' format, and may span multiple rows, so it is not easy to search.) If this is the case you will need to use Metadata Services for a full listing.


Mike Dempsey
Teradata Client Tools



     
  <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: 28 Jun 2020