Suppressing messages using pseudo comments

In this recipe, we will see how we can suppress messages (generated from checks) of a particular category so that they do not appear in the results tree. It is not possible to hide all messages. However, there are some that may be hidden. These are known as exception.

In this recipe, we will see the different ways of finding out whether a particular message may be hidden and the code for hiding such messages using pseudo-comments.

How to do it...

Carry out these steps:

  1. From the message results, navigate to the specific message that you like to suppress.
  2. Expand the message to display its details.
  3. Then, check if the icon How to do it... is displayed before the message as shown in the following screenshot:
    How to do it...
  4. Click the How to do it... icon. This will display the dialog box, as shown in the following screenshot:
    How to do it...
  5. Note the comment. This may be included in the coding with the statement that generated the message as shown as follows:
    SELECT * FROM ZTAB.                "EC# CI_NOWHERE

How it works...

We used the results to find out whether the message may be suppressed or not. The presence o f the icon confirmed the possibility of hiding the NO_WHERE message. We then wrote the pseudo comment along with the SELECT statement. When we rerun the inspection, the SELECT statement with the pseudo comment will not be shown in the messages.

Suppose we need to suppress message for multiple SELECT statements, we need to write the corresponding pseudo comment correctly with each statement.

There's more...

We can also find out the pseudo comment of a check ( if applicable) directly from the categories and checks display. For this, expand the relevant category folder in order to display the relevant check. Click the There's more... icon next to the check title. This will display the documentation of the check in a separate window. The pseudo comment will then be displayed at the end of the window as shown in the following screenshot:

There's more...
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.21