Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Mon, 24 Feb 2003 @ 21:51:47 GMT

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

Subj:   Re: Extracting DDL of a whole database
From:   Jim Downey

I have done the following for different reasons but you might be able to us the process.

First make a query to make the queries:

sel   'Show '||
      when tablekind='G' then ' Trigger '
      when tablekind='I' then ' Join Index '
      when tablekind='M' then ' Macro '
      when tablekind='P' then ' Procedure'
      when tablekind='T' then ' Table '
      when tablekind='V' then ' View '
      ';' as XQL
from  DBC.Tables
Where databasename like ('%%')
and   tablename like ('%%')
order by    databasename,tablename

Then paste the results into queryman.

Change queryman to export the results to a single file.

Tools, options, answerset, check 'write all answersets to a single file'.

File, export results.

Run all the commands. The results will be written to a single file which can then be executed on the target system. You can use a text editor to remove the 'Request Text' which precedes each result set and to make any databasename or tablename changes.


  <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: 28 Jun 2020