Querying Project Tables

You can query specific data that is stored in your project or template project. You query a project by defining and running SQL queries. The following examples show SQL queries and the results that they return.

Query

Results

select * from BUG
where BG_STATUS = 'Open'

All defects that are open.

select * from BUG
where BG_RESPONSIBLE = 'james_alm' or BG_RESPONSIBLE = 'mary_alm'

All defects assigned to either James or Mary.

select count (*) from BUG
where BG_RESPONSIBLE = 'mary_alm'

The number of defects assigned to Mary.

select * from BUG
where BG_RESPONSIBLE='james_alm' and BG_STATUS='open'

All open defects assigned to James.

Using the first query example, the SQL query returns the following:

To query a project:

  1. In Site Administration, click the Site Projects tab.

  2. In the Projects list, double-click a project.

  3. Select a table. ALM automatically runs the "SELECT *" query for this table and displays all the data for the table in the SQL Query Results grid.

  4. Define a query by typing an SQL statement in the SQL pane.

    To navigate back to your previous SQL statement in the SQL pane, click the Up button .

    To navigate forward to your next SQL statement in the SQL pane, click the Down button .

  5. Click the Execute SQL button. The data returned by the query appears in the SQL Query Results grid.

Tip: To export query results, your database administrator can run the same queries on the project database and export the results for you. For details, see Exporting Projects.