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 | ✅ |
| 8.2.x | ✅ |
| 8.1.x | ✅ |
| 8.0.x | ✅ |
Applicable RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ❓ |
| Microsoft SQL Server | ❓ |
| CSS2 | ✅ |
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