How to extract the query from a report or filter
book
Article ID: 256393
calendar_today
Updated On:
Products
IT Management Suite
Issue/Introduction
The customer wants to access the SQL query used for an existing report or filter to use as an example to create his own.
Resolution
There are a couple of ways that you can see the SQL query used:
- Most default reports have the "Edit" option grayed out. If you clone the report or filter, it should be available to you to click on it.
![](https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=1092805785626)
After clicking on "Edit", you should see the "Resolved Query" tab. This tab will have the SQL query that is used for that report.
![](https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=1092809885528)
- Usually, any SQL query used in our reports or filters can be displayed if you right-click on the report and select "view as xml"
![](https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=1092816840286)
- or if you export it and open the XML,
![](https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=1092815688972)
you should see a <query> section:
![](https://api-broadcom-ca.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=1092810257442)
Most reports or filters are straight forward with their queries. Others may use functions or stored procedures to grab the data needed for the report.
Feedback
thumb_up
Yes
thumb_down
No