SQL error options and negative SQL code options


Apptune captures SQL errors by monitoring the codes that the executed SQL statements return. By default, the product treats negative SQL codes as SQL errors.

You can also do the following:

  • Specify to include some or all positive SQL codes as SQL errors.
  • Use the SQL code to determine whether to perform any or all of the following:
    • Report details.
    • Issue operator messages.
    • Generate exceptions.

To view and modify the options, expand the SQL Error Options section on the filter panel (as shown in the following figure):

SQL error options


                            VMFILTER - Test filter             
Command ===>                                   Scroll ===> PAGE
                                                                          
Filter: Off                                             More:   
-   Program  Plan     User ID  Corr ID      ConnType Client Label DB2
  + *        PLANA    *        *            *        LABEL*       *    
  - *        *        *        *            *        *            *  
    Application name . . . . . . . . . . . . .  *                                         
    Client application . . . . . . . . . . .  > *                                    
    Client user ID . . . . . . . . . . . . .  > *
    Client workstation . . . . . . . . . . .  > *
    Client accounting. . . . . . . . . . . .  > *                               
    Client correlation . . . . . . . . . . .  > *                                  
    Collect advanced metrics   (Y,N,S=Static,D=Dynamic). . . .  Y                        
     If not collected for statement, skip all for thread . . .  N                        
     Standard mode: is this row eligible for advanced metrics?: N                        
    Standard Mode: collect SQL errors as specified below . . .  Y                        
    Standard Mode: collect exceptions as specified below . . .  N      
    + Collection Options      (Y=Yes, N=No)                     
    + Collection Keys         (Y=Yes, N=No)
    + Resource-Saving Options (Y=Yes, N=No, R=Replace)
    + Thresholds for Exceptions and Efficient Statements
    - 
SQL Error Options
             Include + codes. . . I (Y=Yes, N=No, I=Incl, E=Excl)
                Positive codes . > 123 (Incl/Excl List, e.g. +100,+101)
                Fetch +100 . . . . Y (Yes/No)
             Report detail. . . . - (Yes/No, -=Neg, I=Incl, E=Excl)
                 Report codes . . > (Incl/Excl List, e.g. -204,-805)
                 Report limit . . . 5 (1-999, or 0 for unlimited)
             WTO reported errors. I (Yes/No, -=Neg, I=Incl, E=Excl)
                  WTO codes. . . . > -104 (Incl/Excl List, e.g. -204,-805)
             Generate exceptions. E (Yes/No, -=Neg, I=Incl, E=Excl)
                 Exception codes. > -204,-805,-904 (Incl/Excl list, e.g. -204,-805)
        Show hostvars on exceptions and SQL errors Y (Y=Yes, N=No)

The following table describes the options that control SQL error monitoring and reporting. 



Label 

Description

Include positive codes

Specifies whether positive SQL codes (warnings) are counted as errors

  • Specify Y (Yes) to count all positive SQL codes as errors.
  • Specify N (No) to prevent counting positive SQL codes as errors.
  • Specify I (Include) to count specified SQL codes as errors.
  • Specify (Exclude) to exclude specified SQL codes from error counts.

Positive codes

If you specify I or E in the Include positive codes option, the Positive codes option displays a list of the included or excluded positive codes. The list is comma-delimited. Plus signs are optional.

Fetch +100

Specifies whether to show +100 codes from fetch
APPTUNE captures +100 codes from fetch only if the both of following conditions are met:

  • No rows were returned on the cursor.
  • This option is set to Y

Report detail

Specifies whether generates detailed reports based on the SQL code

  • Specify Y to generate detailed reports for all SQL errors.
  • Specify N to prevent generation of detailed reports for SQL errors.
  • Specify I to generate detailed reports only for SQL codes listed in the Report codes/Detail Codes option.
  • Specify E to generate detailed reports for all SQL codes except those listed in the Report codes/Detail Codes option.
  • Specify - (minus sign) to generate reports for all negative SQL codes.

The product generates detailed reports for those SQL codes that are included for generating WTO (Write To Operator) messages in the WTO reported errors/WTO codes option. In this case, the WTO reported errors/WTO codes option setting overrides the Report detail/Capture Detail option setting.

Report codes

If you specify I or E in the Report detail/Capture Detail option to generate detailed reports, use this option to enter the codes that you want to include or exclude.

If you specify - (minus sign) in the Report detail option, you may also include positive codes here to generate detailed reports for all negative codes and the selected positive codes.

Report limit

The number of consecutive times that the product reports detail for the same code on the same statement
Specify (zero) for no limit.

WTO reported errors

Specifies whether generates WTO (Write To Operator) messages to the console based on SQL code

  • Specify Y to generate WTO messages for all SQL errors.
  • Specify N to prevent generation of WTO messages for SQL errors.
  • Specify I to generate WTO messages only for the SQL codes listed in the WTO codes option.
  • Specify E to generate WTO messages for all SQL codes except those listed in the WTO codes option.
  • Specify - (minus sign) to generate WTO messages for all negative SQL codes.

WTO codes

If you specified I or E in the WTO reported errors/Issue WTO option to generate WTO messages, use this option to enter the codes that you want to include or exclude.

If you specify - (minus sign) in the WTO reported errors option, you may also include positive codes to generate WTO messages for all negative codes and the selected positive codes.

Generate exceptions

Specifies whether generates exception reports with detailed performance statistics based on SQL code

  • Specify Y to generate exception reports for all SQL errors.
  • Specify N to prevent generation of exception reports for SQL errors.
  • Specify I to generate exception reports only for the SQL codes that are listed in the Exception codes option.
  • Specify E to generate exception reports for all SQL codes except those listed in the Exception codes option.
  • Specify - (minus sign) to generate exception reports for all negative SQL codes.

Exception codes

If you specified I or E in the Generate exceptions option to generate exception reports, use this option to enter the codes that you want to include or exclude.

If you specified - (minus sign) in the Generate exceptions option,
you may also include positive codes to generate exception reports for all negative codes and selected positive codes.



||contentGoal| | ||databaseType| | ||environmentType| | ||installationMode| | ||integratedProduct| | ||interfaceType | | ||languages| | ||mediaType| | ||os| | ||platform | | ||securityType| | ||translation| | ||userExpertise| | ||userGoal| | ||userRole| | ||synonyms| | ||keywords|administration|


GUID-526B7958-F693-4A44-90E0-943F7355442D

 

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

Common Db2 documents 13.1