SQL Queries - CAST Central Base - Queries on Metrics - How to find out whether a given metric has been calculated in a given snapshot

Purpose of Query

This query on the central base determines if a metric has been calculated for a given snapshot.

Applicable CAST Version

ReleaseYes/No
8.3.x
8.2.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS

Query for CSS

SELECT *
FROM   dss_metric_results
WHERE  metric_id          = <metric_id>
AND    METRIC_VALUE_INDEX = 2

Query result example

2230;54;2;237;“NULL”;0;1;0
2230;54;2;237;“NULL”;0;10;0
2230;54;2;237;“NULL”;0;11;0
2230;54;2;237;“NULL”;0;12;0

Query result interpretation

If the metric has not been calculated,  the query returns no row. If the metric has been calculated, the query returns one row per OBJECT_ID, where OBJECT_ID represents the associated module. 

In the results above, the metric_id is 2230, the object_id is 54, and the snapshot_ids are 1, 10, 11, and 12, so that this metric was calculated in these snapshots.

If the results desired are to just check the results above for a particular snapshot, then you can add the clause ‘AND snapshot_id= <snapshot_id>’ with the appropriate snapshot_id to the query above

Query for Oracle

Enter the SQL query

Query result example

Query result interpretation

Query for SQL server

Enter the SQL query

Query result example

Query result interpretation

Notes/comments

Related Pages