Sample output from generating SQL

When you use the GEN command, Db2 Admin Tool generates DDL statements for the specified object or objects.

The following figures show examples of the generated SQL:

Figure 1. Sample output from generating SQL for a database
------------------------------------------------------------------------ 
--                                                                    -- 
-- Database 2 Administration Tool (DB2 Admin) , program 5655-W34      -- 
--                                                                    -- 
-- ADB2GEN  -  Extract object definitions from the DB2 Catalog tables -- 
--                                                                    -- 
-- Input prepared on : DSNA (1015 )   Extract time : 2013-05-14 07:37 -- 
--                                                                    -- 
-- Catalog values overridden : none                                      
--                                                                    -- 
-- Generate : SG=N DB=Y TS=Y TB=Y VW=Y IX=Y SY=Y AL=Y LB=N CM=N FK=N  -- 
--            TG=Y UT=N UF=N SP=N SQ=N RO=N TC=N MK=Y PM=Y AC=Y       -- 
-- Grants   : SG=N DB=N TS=N TB=N VW=N SC=N UT=N UF=N SP=N SQ=N       -- 
--                                                                    -- 
------------------------------------------------------------------------ 
------------------------------------------------------------------------ 
--                                                                    -- 
-- ADB2GEN: Generate DDL for Database DSNDB06                         -- 
--                                                                    -- 
------------------------------------------------------------------------ 
--                                                                       
--                                                                       
------------------------------------------------------------------------ 
------------------------------------------------------------------------ 
--                                                                       
  SET CURRENT SQLID='SYSIBM';                                            
--                                                                       
--#SET ACCEPT_RC 0 -618                                                  
--                                                                       
  CREATE DATABASE DSNDB06                                                
    INDEXBP    BP0                                                       
    CCSID      EBCDIC;                                                   
--                                                                       
Figure 2. Sample output from generating SQL for a table space
------------------------------------------------------------------------ 
-- Table space=DSNDB06.SYSALTER                                          
------------------------------------------------------------------------ 
--                                                                       
  CREATE TABLESPACE SYSALTER                                             
    IN DSNDB06                                 
--  VCAT "00000001" -- DB2 catalog tablespace  
    FREEPAGE 0 PCTFREE 7                       
    GBPCACHE CHANGED                           
    TRACKMOD YES                               
    LOGGED                                     
    SEGSIZE 4                                  
    BUFFERPOOL BP32K                           
    LOCKSIZE ROW                               
    LOCKMAX SYSTEM                             
    CLOSE NO                                   
    COMPRESS NO                                
    CCSID      UNICODE                         
    DEFINE YES                                 
    MAXROWS 255;                               
--                                                                    
Figure 3. Sample output from generating SQL for a view
 ------------------------------------------------------------------------
– View=XXXXX.VWEMPLOY1
------------------------------------------------------------------------
SET CURRENT SCHEMA='XXXXX';
SET CURRENT PATH = "SYSIBM","SYSFUN","SYSPROC","XXXXX" ;
SET CURRENT APPLICATION COMPATIBILITY = 'V12R1M506 ';
CREATE VIEW TSLHC.VWEMPLOY1(EMPNO, FIRSTNME, LASTNAME) AS
SELECT EMPNO, FIRSTNME, LASTNAME
FROM TSLHC.EMPLOYEE;
SET CURRENT APPLICATION COMPATIBILITY = 'V12R1M507 ';
COMMIT;
------------------------------------------------------------------------  

If you specified that REBIND commands were to be generated, the REBIND output is also included, as shown in the following figure:

Figure 4. Sample output of generating SQL with the REBIND option specified
 -------------------------------------------------------------------------------
 EDIT       SYS01311.T012717.RA000.ISTJE.R0215994           Columns 00001 00072 
 Command ===>                                                  Scroll ===> PAGE 
 ****** ***************************** Top of Data ******************************
																												
 000001   REBIND PACKAGE(DSN8ES81.DSN8ES1)                                      
 ****** **************************** Bottom of Data ****************************
Note: In some cases, data-partitioned secondary indexes might be included in the output, because the process to generate the SQL supports these indexes.