Exporting SQL text to a data set
Db2 Query Monitor enables you to export SQL text of interest to a data set of your choice.
About this task
This task uses the EXPORT command, which is valid only when viewing the entire SQL. It is not valid on the SQL Activities panel.
Procedure
To export SQL text to a data set:
-
Navigate to the Display SQL Statement Text
panel.
You can navigate to this panel from the main menu by selecting any of the following options:
- 1 (View Activity Summaries)
- After you press Enter, complete the following steps:
- On the Select Summary Level panel, select any option depending on how you want to view the data and press Enter.
- On the Operational Summaries panel, specify the S line command next to the row of interest.
- On the Activity by SQL Text panel, specify the V or VF line command next to the SQL statement that you want to view.
- 3 (View Current Activity)
After you press Enter, the Current SQL Activity panel is displayed. Specify the S or SF line command next to the activity of interest.
- 5 (View Exceptions)
- After you press Enter, the Display Exceptions panel is displayed. Specify the S or SF line command next to the exception of interest.
Note:The VF and SF line commands display formatted SQL. The V and S line commands display the full SQL as is and do not ensure that it is formatted. To use the VF and SF line commands, you must have Db2 Admin Tool installed and enabled for use with Db2 Query Monitor, so that these line commands can invoke the Db2 Admin Tool stored procedure ADB2FMP.
- On the Display SQL Statement Text panel, type EXPORT in the Option line and press Enter.
-
On the Export SQL Text to DSN
panel, specify the data set to
which you want to export SQL text, and, if the data set is a PDS, the member name:
Figure 1. Export SQL Text to DSN panel CQM$EXPT--------------- Export SQL Text to DSN --------------------- Option ===> _________________________________________________ Export to data set ... _______________________________________ Member. ________ (Required if data set is a PDS) Execute SQL/PA against exported data set Y/N Y Press Enter to process request or PF3/CANCEL to exit
- Optional: If you want to use SQL PA to analyze the data set containing the exported SQL text, specify Y in the Execute SQL/PA against exported data set field.
- Press Enter to process your request.