Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 10 Nov 2009 @ 08:03:29 GMT


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


Subj:   Re: Multi Level Dependant Views
 
From:   Murali.Deenadayalan

Hi,

One way of getting the list is:

     SELECT
        databasename, tablename
     FROM
        dbc.tables
     WHERE
        tablekind='V' AND requesttext LIKE '%tablename%';

Remember this will even pick the tables

1) that are commented in the view definition.

2) those names are part of other tablename/columnname/keyword or anything written in the view definition(for eg. table "EMP" also searches views that refer "EMP_DETAIL" table OR "EMP_ID" column.) Better use

     requesttext LIKE ('%tablename %') OR requesttext LIKE '%tablename,%')

ie. with space OR comma added at the end of search pattern

If you qualify your tables with databasenames in your view definition, the above scenarios can be avoided. requesttext LIKE 'databasename.tablename%'; which is generally not recommended in multi environment applications (dev, qa and prod servers)


thanks & regards,

Murali D.



     
  <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