View SQL Error Codes

You can view all SQL errors that were captured for the current interval.
caddb2
You can view all SQL errors that were captured for the current interval. This function helps you determine which SQL errors occur most frequently. You can select an SQL code and then view all users or programs that encountered the error.
Many false -805 SQL errors can be generated by the remote Db2 subsystem during a package lookup. The local Db2 subsystem records and displays only true -805 SQL errors from the remote subsystem. The remote subsystem does not collect any -805 errors during the package lookup. For distributed requests that run under the DISTSERV plan, all -805 SQL errors are recorded and displayed on both the local and remote subsystems.
Follow these steps:
  1. Type
    E
    in the View Type field of any panel containing that field and press Enter.
    The SQL Error Summary Display appears. The View By field defaults to SQLcode.
  2. Specify
    one
    of the following line commands next to an SQL error code:
    • U (View Users)
      Formats the SQL error data on the SQL ERROR User/SQLCODE Summary panel. The output is summarized by user and it is listed chronologically with the most recent occurrence first. After you select a user, the SQL Error Detail Display appears, showing all statements that generated a particular SQL code for the user. The SQL statements are listed chronologically with the most recent occurrence first.
    • G (View Programs)
      Shows all programs (DBRMs or packages) that generated the selected error code on the SQL Error Program/SQLCODE Summary panel. The detail lines are listed chronologically with the most recent occurrence first. After you select a program, the SQL Error Detail Display appears, showing all statements that generated a particular SQL code for the program. The SQL statements are listed chronologically with the most recent occurrence first.
    • L (View List)
      Shows the SQL statements that generated the selected error code during the interval. Up to 999 SQL statement detail lines can appear. The statements are listed chronologically, with the most recent occurrence first.
    Press Enter.
    The panel for the specified command appears.
  3. Specify
    one
    of the following line commands:
    • S (SQLCA Message Display)
      Shows the SQLCA area for the SQL call that issued the return code on the SQLCA Data Area Display. You can switch between showing the SQLCA area message and showing the SQLCA area in hexadecimal.
    • Q (SQL Call Text)
      Shows the SQL call text on the SQL Call Text Display (static SQL calls) or the SQL Call Dynamic SQL Summary Display (dynamic SQL calls).
    • V (View Detail)
      Shows all SQL statements that generated a particular SQL code for the user being viewed on the SQL Error Detail Display. This option lets you view the data columns with less scrolling. The fields are grouped by SQL error environment information, SQL error data from the SQLCA, and warning information from the SQLCA.
    Press Enter.
    The SQL error code panel appears.