Creating a query to a JDBC or ODBC database

The Query editor has a text editor for composing free-form SQL statements to any JDBC- or ODBC-compliant database located on the computer where the Cloud Pak System Software Monitoring Portal server is installed.

Before you begin

Your user ID must have Modify Query permission for this function. If you do not see the Queries tool, your user ID does not have View or Modify Query permissions; if you can open the Query editor but the tools are disabled, your user ID does not have Modify Query permission.

About this task

Use this task to create a new query of JDBC or ODBC attributes, thus enabling you to integrate systems management data from monitoring agents with data from other sources in one workspace.

Procedure

  1. Do either of the following actions to open the Query editor:
    • Click Query Query editor in the main toolbar.
    • In the title bar of the view where you want to apply the new query, click Properties editor - viewProperties > QueryClick here to assign a query.
  2. Click create query Create New Query.
  3. In the Name field, type a name of up to 32 letters, numbers, underscores (_) and spaces and, optionally, in the Description field, type a description of up to 256 characters and spaces.
  4. From the Category List box list, select the folder where you want the new query to appear in the Queries tree.
  5. Select a JDBC or ODBC database in the Data Sources list.
    Check box selected/dimmed Custom SQL is selected for you. If you do not see the database for which you want to create the query, it must be added through Manage Tivoli Monitoring Services.
  6. Click OK.
    The new query is displayed in the Queries tree under agentFolder (where Folder is the Category you selected) in the nodeCustom_SQL folder. The Specification tab opens with a Custom SQL text box for you to enter SQL commands.
  7. Write an SQL SELECT statement in the text box using the correct syntax.
    You must be familiar with SQL commands and syntax to write a valid SQL query.
  8. When you are finished writing the SQL statement, click Apply to save the query and keep the window open; or click OK to save the query and close the window.

What to do next

If the view remains empty after you assign the query, the query has not been entered correctly. Review the notes for JDBC or ODBC database queries and return to the Query editor to edit the SELECT statement as needed.