Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 28 Sep 2011 @ 13:47:24 GMT


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


Subj:   Re: How to Fetch tables from Database with different suffixes
 
From:   Bodla, Sravan Kumar

Hello All,

In the Database, there are thousands of tables, with different dates as suffix

If I give like below, am getting only few backup tables which ends with specific date.

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

Or

     SELECT * FROM DBC.TABLES
     WHERE DATABASENAME = 
       AND TABLENAME LIKE ANY ( '%_2809', '%_1308') ;

But daily we take n no. of tables. I need all those tables which has different dates as suffix.

     T_Abc_1_b_2809
     T_234Xyzsdf_abcdf_12_1308
     T_1_Pqrst_abc_123_cd_1407
     Ijkl_pqr_11_bcd_1206
     T_1138_Ikl_pqr_11_bcd_1102
     T_1_xyzst_abc_123_cd_0711
     T_1_asdfer_abc_234_cd_0203
     T_1_elidt_abc_32_cd_0901

Etc,etc etc


Thanks,

Sravan.



     
  <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