SQL Queries - CAST Knowledge Base - Queries on objects - How to get and delete GUID of duplicate objects in KB

Purpose of Query

This page provide the query to get the GUID of duplicate objects and how to delete those objects

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



Query for CSS
Run the below query on your Knowledge Base, to get the 'GUID' duplicate objects.


SELECT  IDNAM, FULLNAME, OBJTYP  FROM OBJECTS o join OBJFULNAM f on f.IDOBJ = o.IDKEY
where IDNAM in (SELECT  IDNAM  FROM OBJECTS group by IDNAM  having count(*) > 1)


Run the below query on your Knowledge Base (in the PL/SQL example, replace the first parameter of OBJECT_DELETE function with the object id that you want to delete)

begin
  declare L_ID int:= -1;
      L_ErrorCode int;
  begin
    L_ErrorCode:=InitConnection(L_ID, 'CASTCORP\xxxx');
    L_ErrorCode:=OBJECT_DELETE (1,0);
  end;
end;



Query result example

Query result interpretation

Query for Oracle
Enter the SQL query
Query result example

Query result interpretation

 
Query for SQL server
Enter the SQL query
Query result example

Query result interpretation

Notes/comments



Related Pages