SQL Queries - CAST Knowledge Base - Queries on objects - How to list the files that do not have child objects to locate Missing objects

Purpose of Query

The main purpose of this query is to get all the files that do not have child objects.

Applicable CAST Version

ReleaseYes/No
8.3.x
8.2.x
8.1.x
8.0.x
7.3.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS2

Query for CSS

The CSV update have to be executed:

 select * from CDT_OBJECTS p where not exists (select 1 from CTT_OBJECT_PARENTS op where op.PARENT_ID = p.OBJECT_ID) and p.OBJECT_ID IN (select idfil from objfilref)

Query result example

Query result interpretation

The query has generated all the files that do not have child objects.

Query for Oracle

The CSV update have to be executed

 select * from CDT_OBJECTS p where not exists (select 1 from CTT_OBJECT_PARENTS op where op.PARENT_ID = p.OBJECT_ID) and p.OBJECT_ID IN (select idfil from objfilref)

Query result example

Query result interpretation

The query has generated all the files that do not have child objects.

Related Pages

Have to be included to the troubleshooting + Generalize to other technologies