SQL Queries - Common SQL Queries - Queries on metamodel - How to get the list of ids with null metamodel values

Purpose of Query

The purpose of this page is to provide queries to detect inconsistencies in the meta model related to categories and type of objects

Applicable CAST Version
Release
Yes/No
8.3.x(tick)
8.2.x(tick)
8.1.x(tick)
8.0.x(tick)
Applicable RDBMS
RDBMS
Yes/No
Oracle Server (question)
Microsoft SQL Server (question)
CSS2 (tick)

 

Query for CSS

The following query detects association between categories for which the parent category (the one from which a category is inherited) does not exist anymore, this is an inconsistency that can prevent CAST MS to open once the management schema has been selected. It gives the list of Categories (idcatparent) that must be removed

SELECT    *
FROM      CATCAT cc
          LEFT JOIN CAT ca
          ON        cc.idcatparent = ca.idcat
WHERE     ca.idcat           IS NULL;

 The following query detects association between category and type of object for which the type of object does not exist anymore. It gives the list of type (idtype) that needs to be purged

SELECT    *
FROM      TYPCAT tc
          LEFT JOIN TYP t
          ON        tc.idtyp = t.idtyp
WHERE     t.idtyp      IS NULL;
Notes/comments


Related Pages