Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 02 Feb 2007 @ 18:50:35 GMT


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


Subj:   Re: How to dump all object definitions in a database
 
From:   Vinay Bagare

This script should help you

     .SET WIDTH 254
     .SET TITLEDASHES OFF
     .SET ERROROUT STDOUT
     .RUN FILE Logon.txt
     .OS IF EXIST Ddl.sql DEL Ddl.sql
     .OS IF EXIST Ddl_txt.txt DEL Ddl_txt.txt

     .EXPORT REPORT FILE = DDl.sql
     SELECT
     CASE WHEN TableKind = 'T' THEN 'SHOW TABLE ' || TRIM(DatabaseName) ||
     '.' || TRIM(TableName) || ';'
          WHEN TableKind = 'V' THEN 'SHOW VIEW '  || TRIM(DatabaseName) ||
     '.' || TRIM(TableName) || ';'
          WHEN TableKind = 'M' THEN 'SHOW MACRO ' || TRIM(DatabaseName) ||
     '.' || TRIM(TableName) || ';'
          WHEN TableKind = 'P' THEN 'SHOW PROCEDURE ' || TRIM(DatabaseName)
     || '.' || TRIM(TableName) || ';'
     END (TITLE '')
     FROM DBC.Tables
     WHERE DatabaseName = 'SYSDBA';
     .EXPORT RESET
     .EXPORT REPORT FILE = Ddl_txt.txt
     .RUN FILE Ddl.sql
     .EXPORT RESET

     .LOGOFF
     .QUIT

Thanks,

Vinay Bagare
Amp'd Mobile Inc
www.ampd.com



     
  <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