Default language.

Information
Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI Unload for Db2 13.1.

Non-corelated subqueries; Unload DIRECT


This example shows that subqueries are also processed DIRECT, even when the subquery is a join. The subquery can reference a table or a file. In this example, the subquery is passed to Db2 to get the values for the col01 predicate. Passing this SQL to Db2 is often more efficient than processing DIRECT do to SQL using indexes.

Information
Example
//UNLOAD   EXEC PGM=NGTUTIL,PARM='ssid,,NORESTART'          
//*                                                         
//UTPRINT   DD SYSOUT=*                                     
//SYSPRINT  DD SYSOUT=*                                     
//SYSTSPRT  DD SYSOUT=*                                     
//OBJREPRT  DD SYSOUT=*                                     
//*                                                         
//SYSIN     DD *                                          
 OUTPUT SYSREC  DSNAME hlq.OUTDATA.&TS..P&PART..T&TIME
 UNLOAD                                                  
    DIRECT YES                                           
      SELECT *                                           
        FROM creator.table01                          
       WHERE col01 IN                                    
         (SELECT X.colnn                                 
          FROM creator.table02 X                      
               ,creator.table03 Y                      
         WHERE X.colnn = Y.colnn                         
           AND X.colnn < 25)                             
/*

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Unload for Db2 12.1