SQL Queries - CAST Knowledge Base - Queries on objects - How to list the technologies present ordered by number of objects
Purpose of Query
The purpose of this query on a CAST knowledge base is to show the technologies present in a knowledge base and order them by the number of objects.
Applicable CAST Version
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
| 8.2.x | ✅ |
Applicable RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ❓ |
| Microsoft SQL Server | ❓ |
| CSS | ✅ |
Query for CSS
SELECT c.TECHNOLOGY AS "Technology",
CASE
WHEN c.TECHNOLOGY_TYPE = c.TECHNOLOGY_CUSTOM_TYPE
THEN c.TECHNOLOGY_TYPE
ELSE c.TECHNOLOGY_TYPE
|| '('
|| c.TECHNOLOGY_CUSTOM_TYPE
|| ' customized)'
END AS "Technology Type",
CASE
WHEN kb.OBJECTS_NB IS NULL
THEN 0
ELSE kb.OBJECTS_NB
END AS "Objects Nb"
FROM (SELECT c.IdCat ,
c.CatDsc AS TECHNOLOGY,
CASE
WHEN c.IdCat < 1000000
THEN 'Core'
WHEN c.IdCat < 1500000
THEN 'CoE'
WHEN c.IdCat < 2000000
THEN 'Prepackaged'
WHEN c.IdCat >= 2000000
THEN 'Client'
END AS TECHNOLOGY_TYPE,
CASE
WHEN MAX(tc.IdTyp) < 1000000
THEN 'Core'
WHEN MAX(tc.IdTyp) < 1500000
THEN 'CoE'
WHEN MAX(tc.IdTyp) < 2000000
THEN 'Prepackaged'
WHEN MAX(tc.IdTyp) >= 2000000
THEN 'Client'
END AS TECHNOLOGY_CUSTOM_TYPE
FROM Cat c
JOIN CatCat cc
ON cc.IdCat = c.IdCat
AND cc.IdCatParent = 6000
JOIN TypCat tc
ON tc.IdCatParent = c.IdCat
GROUP BY c.IdCat,
c.CatDsc
)
c
LEFT JOIN
(SELECT cc.IdCat,
COUNT(1) AS OBJECTS_NB
FROM CatCat cc
JOIN TypCat tc
ON tc.IdCatParent = cc.IdCat
AND cc.IdCatParent = 6000
JOIN Keys k
ON k.ObjTyp = tc.IdTyp
WHERE tc.IdCatParent = cc.IdCat
GROUP BY cc.IdCat
)
kb
ON kb.IdCat = c.IdCat
ORDER BY
CASE
WHEN kb.OBJECTS_NB IS NULL
THEN 0
ELSE kb.OBJECTS_NB
END DESC,
c.TECHNOLOGY;
Query result example
“C#”;“Core”;104935
“.NET”;“Core”;28665
Query result interpretation
Each line returned shows the technology, the number of objects for that technology and a designation indicating if the objects are Core technologies supported by CAST (“Core”), Official COE technologies or technologies supported through extensions (“COE”), Prepackaged technologies (“Prepackaged”), or Client based Universal Analyzer technologies (“Client”)
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