Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 04 Feb 2010 @ 11:16:35 GMT


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


Subj:   Re: Moving subset of tables/views/applications/users
 
From:   Ulrich

Hi Steve,

this should give you a good insight - as long as you do not have MDS. Did it myself - best is to export the result set via bteq - see example below:

I generated the show sel * statements via the comment SQL and copied them into the BTEQ (might also be done also in one script with two exports and one run statement),

The Select 'Start: ###db.tab###' (title ' ');

is generating nice separators for the parsing of the output - which has then to be coded. you will find also JI there...

The output can become quite interesting in case of views on views on views ;-)...


Regards Ulrich


P.S. same works also for Macros, but need more preparation for the show exec statement as you have to put in dummy parameters...

     SAMPLE BTEQ:

     .logon sys/user;
     .set width 200;

     /*
     .os "del ./script.txt";

     .set titledashes off;
     .export Report file = "./script.txt";

     select
     top 2
     'Select ''Start: ###' !! trim(databasename) !! '.' !!
     trim(tablename) !!'###'' (title '' '');
     show select * from ' !! trim(databasename) !! '.' !!
     trim(tablename) !! ';
     Select ''  End: ###' !! trim(databasename) !! '.' !!
     trim(tablename) !!'###'' (title '' '');'
     (title ' ')
     from dbc.tables
     where databasename = 'xxx'
     and tablekind = 'V'
     and tablename like 'whaterver%'
     order by 1
     ;

     .export reset;
     */


     .export Report file = "./out.txt";

     Select 'Start: ###db.tab###' (title ' '); show select * from db.tab; Select '  End: ###
     db.tab ###' (title ' ');

       --


     
  <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