Viewing SQL statements for a collection

You can use Db2 Admin Tool to view the SQL statements that are included in a collection of packages.

Procedure

To view SQL statements for a collection:

  1. On the DB2 Administration Menu (ADB2) panel, specify option 1, and press Enter.
  2. On the System Catalog (ADB21) panel, specify option L (for collections), and press Enter.
  3. On the Collections (ADB21L) panel, specify the SQ line command next to the collection for which you want to view the SQL statements, and press Enter:
    The Extracted SQL (ADB21KSE) panel displays the SQL statements for each package in the collection:
    Figure 1. Extracted SQL (ADB21KSE) panel
     DB2 Admin ----------------- Extracted SQL ---------------- Columns 00001 00072 
     Command ===>                                                  Scroll ===> PAGE 
     Max no of rows reached                                                         
     ****** ***************************** Top of Data ******************************
     000001 -- SQL statements in PACKAGE : ADBL31.ADBMAIN.()                        
     000002 -- SQL in stmt: 605                                                     
     000003 COMMIT WORK                                                             
     000004 -- SQL in stmt: 2601                                                    
     000005 DECLARE S1 STATEMENT                                                    
     000006 -- SQL in stmt: 2643                                                    
     000007 PREPARE S1 FROM :H                                                      
     000008 -- SQL in stmt: 2747                                                    
     000009 DESCRIBE S1 INTO :H                                                     
     000010 -- SQL in stmt: 2759                                                    
     000011 EXECUTE S1                                                              
     000012 -- SQL in stmt: 2884                                                    
     000013 DECLARE C1 CURSOR FOR S1                                                
     000014 -- SQL in stmt: 2890                                                    
     000015 OPEN C1                                                                 
     000016 -- SQL in stmt: 2902                                                    
     000017 FETCH C1 USING DESCRIPTOR :H                                            
     000018 -- SQL in stmt: 2973                                                    
     000019 CLOSE C1                                                                
     000020 -- SQL in stmt: 5754                                                    
     000021 COMMIT WORK                                                             
     000022 -- SQL in stmt: 5781                                                    
     000023 ROLLBACK WORK                                                           
     000024 -- SQL in stmt: 5786                                                    
     000025 COMMIT WORK                                                             
     000026 -- SQL statements in PACKAGE : ADBL31.ADB2CON.()                        
     000027 -- SQL in stmt: 123                                                     
     000028 CONNECT RESET                                                           
     000029 -- SQL in stmt: 128                                                     
     000030 CONNECT                                                                 
     000031 -- SQL in stmt: 134                                                     
     000032 CONNECT TO :H                                                           
     000033 -- SQL statements in PACKAGE : ADBL31.ADB2GEN.()                        
     000034 -- SQL in stmt: 1917                                                    
     000035 DECLARE C_SYSDAUTH CURSOR FOR SELECT * FROM SYSDBAUTH WHERE NAME = :H   
     000036 AND GRANTOR <> GRANTEE ORDER BY DATEGRANTED, TIMEGRANTED                
     000037 -- SQL in stmt: 1931                                                    
     000038 OPEN C_SYSDAUTH