Purpose of Query
The below SQL queries provides the DETAIL and TOTAL procedures of Quality rules.
Applicable CAST Version
Release | Yes/No |
---|---|
8.3.x | |
8.2.x | |
8.1.x | |
8.0.x | |
7.3.x |
Applicable RDBMS
RDBMS | Yes/No |
---|---|
Oracle Server | |
Microsoft SQL Server | |
CSS3 | |
CSS2 |
Query for CSS
Run the following queries on the CB:
SELECT TT.METRIC_SCOPE_PROCEDURE_NAME AS DetailProc , T.METRIC_ID , T.METRIC_NAME , COALESCE(P.OBJECT_TYPE_ID,0) AS OBJECT_TYPE_ID, VT.METRIC_VALUE_PROCEDURE_NAME AS TotalProc FROM DSS_METRIC_TYPE_TREES TT , DSS_METRIC_VALUE_TYPES VT , DSS_METRIC_TYPES T LEFT OUTER JOIN DSS_METRIC_PARAM_TYPES P ON ( P.METRIC_ID = T.METRIC_ID AND P.PARAM_INDEX = 1 ) WHERE T.METRIC_GROUP = 1 AND TT.METRIC_ID = T.METRIC_ID + 1 AND VT.METRIC_ID = T.METRIC_ID AND VT.METRIC_VALUE_INDEX = 2 AND metric_name LIKE '%<METRIC_NAME>%' ORDER BY METRIC_NAME
For example the Metric "Private Fields naming convention - case and character set control" give the following result:
Query result exampledetailproc
character varying(255)
metric_id
integer
metric_name
character varying(255)
object_type_id
integer
totalproc
character varying(255
DIAG_SCOPE_NETNAM007 3562 Private Fields naming convention - case and character set control 138385 DIAG_DOTNET_ANA_PV_FIELD_TOTAL DIAG_SCOPE_NETNAM007 3562 Private Fields naming convention - case and character set control 141901 DIAG_DOTNET_ANA_PV_FIELD_TOTAL DIAG_SCOPE_NETNAM007 3562 Private Fields naming convention - case and character set control 138383 DIAG_DOTNET_ANA_PV_FIELD_TOTAL The DETAIL procedure corresponding to the provided metric is given in the detailproc column.
The TOTAL procedure is given in the totalproc column.
- Connect to PG Admin
- Go to the browser and navigate to the central schema
- Expand the central schema and then expand functions
- For pgadmin3, select the function (detail or total procedure from above) and the sql for the procedure will show up in the default sql pane
- For pgadmin4, select the function (detail or total procedure from above), right click, and then go to 'Scripts→Create Script', and the sql for the procedure will show up in a new tab.
- Retrieve the script corresponding to each procedure
Query for Oracle
Query result example
Query result interpretation
Query for SQL server
Query result example
Query result interpretation
Notes/comments
Related Pages