SQL Queries - CAST Knowledge Base - Queries on objects - How to set Objects as external so as to ignore them

Purpose of Query

In order to ignore some objects in the snapshot computation, you can set them as external ones in the KB. So these objects will not be taken into account in the computation of the metrics grades neither of in the computation of technical size values to set object(s) as external

PLEASE NOTE:  THE QUERIES BELOW ARE ONLY VALID IN CAST AIP 8.3.36 AND BELOW.  FOR CAST AIP 8.3.37 AND ABOVE YOU MUST MODIFY THE QUERIES AS FOLLOWS:

  • change references:
    • set properties = 1
  • to
    • set PROPERTIES = PROPERTIES | 256

Applicable CAST Version

ReleaseYes/No
8.3.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS

Query for CSS

UPDATE            <KB_NAME>.CTT_OBJECT_APPLICATIONS
SET    PROPERTIES = 1
WHERE  OBJECT_ID IN
       (SELECT OBJECT_ID
       FROM                       <KB_NAME>.CSV_FILE_OBJECTS
       WHERE   OBJECT_FULLNAME LIKE ('<OBJECT_FULLNAME>')
       )
 
commit

Query result example

Query returned successfully: 16 rows affected, 111 ms execution time.

Query result interpretation

This query will make the object external so those objects will not be taken into account in the computation of the metrics grades

Query for Oracle

UPDATE            <KB_NAME>.CTT_OBJECT_APPLICATIONS
SET    PROPERTIES = 1
WHERE  OBJECT_ID IN
       (SELECT OBJECT_ID
       FROM                       <KB_NAME>.CSV_FILE_OBJECTS
       WHERE   OBJECT_FULLNAME LIKE ('<OBJECT_FULLNAME>')
       )
 
commit

Query result example

Query returned successfully: 16 rows affected, 111 ms execution time.

Query result interpretation

This query will make the object external so those objects will not be taken into account in the computation of the metrics grades

Query for SQL server

UPDATE            <KB_NAME>.CTT_OBJECT_APPLICATIONS
SET    PROPERTIES = 1
WHERE  OBJECT_ID IN
       (SELECT OBJECT_ID
       FROM                       <KB_NAME>.CSV_FILE_OBJECTS
       WHERE   OBJECT_FULLNAME LIKE ('<OBJECT_FULLNAME>')
       )
 
commit

Query result example

Query returned successfully: 16 rows affected, 111 ms execution time.

Query result interpretation

This query will make the object external so those objects will not be taken into account in the computation of the metrics grades

Notes/comments

This query must be obligatory executed after updating CSV.After that, you created and run the snapshot

Always execute the “commit” to avoid performance problem while running the Snapshot

Related Pages