Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 28 Sep 2011 @ 10:03:00 GMT


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


Subj:   Re: How to Fetch tables from Database with different suffixes
 
From:   Maccha, Narayana

Sravan,

     SELECT SUBSTRING(TRIM(tablename)
                 FROM CHARACTER_LENGTH(TRIM(tablename)) -3 FOR 4)
       from dbc.tables where tablename='oldpasswords_2409';

You can use above query and compare the results to the data you want

Exp

     select tablename from dbc.tables
        where SUBSTRING(TRIM(tablename)
                FROM CHARACTER_LENGTH(TRIM(tablename)) -3 FOR 4)='HIST';

     select tablename from dbc.tables
        where SUBSTRING(TRIM(tablename)
                FROM CHARACTER_LENGTH(TRIM(tablename)) -3 FOR 4)='HIST';

      *** Query completed. 643 rows found. One column returned.
      *** Total elapsed time was 1 second.

     TableName
     ------------------------------
     CL_XX_XXXXXXXXXX_HIST
     PARTY_XXXXXXXXXXXXXX_HIST

Thanks and regards,

Machha
Teradata DBA



     
  <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