The SQL Formatter formats SQL statements, verifies syntax, and color-codes variables, invalid field or table names, optimization forces and comments. The use of indenting and highlighting gives SQL statements a standard of formatting that is easy to read.
After entering a SQL statement in the left pane of the window, click .
The formatted SQL statement displays in the right pane of the window. Comments, bind variables, optimizer forces, invalid column or table names, and variables are highlighted in different colors. If there is a syntax error, an error message from DB2 LUW is displayed.
To open the SQL Inspector window
To add an Inspector
After adding an Inspector in the SQL Inspector window, SQL statements and statistics from the monitoring tables are retrieved by executing the Inspect function. The Inspector must first be selected before the inspection can begin. Only one Inspector can be marked at a time.
To start the inspecting process
Select an Inspector job.
If the start time of the Inspector has not been reached, the SQL Inspector waits until it is time to begin. During and at the end of the inspecting, information is updated on the SQL Inspector window. Inspect terminates automatically once the end time is reached, except for ad-hoc inspecting. The ad-hoc inspecting process has no ending time so it must be terminated manually.
To abort the inspecting
Note: If you have already executed the Inspect function for an Inspector, re-executing the Inspect function will erase all existing information.
When your SQL statement uses a temporary table, you must create a temporary table before you use the SQL statement in several modules. When you exit from the program or connect to another session, all the temporary tables you create are dropped.
Click User-Defined Temp Table .
On the Creation tab, enter the statements for creating the temp table. You may include DECLARE GLOBAL TEMPORARY TABLE, INSERT, UPDATE, and DELETE statements.
The SQL Repository stores the SQL statements that are used in the analysis of database performance. These may be SQL statements that you have identified as critical to the performance of your database application.
In the Add SQL window enter the SQL text in the SQL Information tab. Click OK.
The SQL syntax is checked and the access plan retrieved before adding a new node to the SQL tree view with the SQL name. Each SQL statement added to the SQL Repository contains an access plan, SQL classification type (Simple, Complex or Problematic), and the current connection information (login name, database alias, and schema). The access plan stored with the SQL statement is important as it indicates the current performance of the SQL.