SQL Queries - CAST Central Base - Queries on Objects - How to get the LoC associated with an object in a specific snapshot

Purpose of Query

 This page lists the SQL queries required to get the LoC associated with an object in the central base.

Applicable CAST Version
Release
Yes/No
8.3.x(tick)
8.2.x(tick)
Applicable RDBMS
RDBMS
Yes/No
Oracle Server(question)
Microsoft SQL Server(question)
CSS3(tick)
CSS2(tick)
Query for CSS

Identify the object id from the full name and the snapshot id

SELECT dos.object_id 
FROM   dss_objects dos 
JOIN   dss_object_info doi 
ON     doi.object_id = dos.object_id 
WHERE  dos.object_full_name = '<ObjectFullName>' 
AND    snapshotid =<snapshot_id>
Query result example

2757

Query result interpretation

The query returns the object id

Run the following query to get associated LoC

SELECT metric_num_value 
FROM   dss_metric_results dmr 
JOIN   dss_object_info dos 
ON     dos.object_id = dmr.object_id 
JOIN   typ 
ON     idtyp = dos.object_type_id 
WHERE  dmr.metric_id = 10151 
AND    dmr.snapshot_id = 2 
AND    dos.snapshot_id = dmr.snapshot_id 
AND    dmr.metric_value_index= 1 
AND    dos.object_id = <object_id>
Query result example

154

Query result interpretation

The query returns the LOC of the object

Query for Oracle
To be done
Query for SQL server
To be done
Notes/comments

Related Pages