Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 29 Nov 2001 @ 16:58:52 GMT


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


Subj:   Re: Source for DDL in SHOW TABLE
 
From:   Thomas F. Stanek

Scott,

If your objective is to capture the DDL for a set of tables (i.e all the tables in a database), Here is what I do:

Write SQL that will generate "SHOW TABLE " statements based on the contents of the dictionary and then execute the resulting SHOW TABLE statements. Her is a simple example:

SELECT 'SHOW TABLE '
      ||TRIM(DATABASENAME)
      ||'.'
      ||TRIM(TABLENAME)
        ||';'    (TITLE'')
   FROM DBC.TABLES
 WHERE DATABASENAME EQ 'dbname'
;

This should generate a collection of SHOW TABLE statements that can then be executed from BTEQ, Queryman, etc. to generate the DDL for each table in the database. We use this a lot to copy the definitions of the production environment tables to the test environment.


Regards,

Thomas F. Stanek
TFS Consulting



     
  <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