SQL Queries - CAST Knowledge Base - Queries on objects - How to check if objects are internal or external or generated from the application
Purpose of Query
This page contains a query to be run on Knowledge Database which will help us find if the object property is internal/external/generated. Below is the table showing the object property for
| property | value |
|---|---|
| Internal | 0 |
| External | 1 |
| Generated (artificial) | 2 |
| External Generated (artificial) | 3 |
| Unknown | otherwise |
Applicable CAST Version
| Release | Yes/No |
|---|---|
| 8.3.x | ✅ |
Applicable RDBMS
| RDBMS | Yes/No |
|---|---|
| Oracle Server | ✅ |
| Microsoft SQL Server | ✅ |
| CSS | ✅ |
Query for CSS, Oracle, SQL Server
For CAST 8.3.36 and lower:
SELECT cfo.object_fullname,
CASE
WHEN coa.properties = 0 THEN 'Internal'
WHEN coa.properties = 1 THEN 'External'
WHEN coa.properties = 2 THEN 'Generated (artificial)'
ELSE 'Unknown'
END
FROM ctt_object_applications coa
JOIN csv_file_objects cfo
ON cfo.object_id = coa.object_id
AND cfo.object_fullname IN (<'object_fullname1'>,
<'object_fullname2'>,
....,
<'object_fullnameN'>)
For CAST 8.3.37 and higher:
SELECT cfo.object_fullname,
CASE
WHEN coa.properties & 255 = 0 THEN 'Internal'
WHEN coa.properties & 255 = 1 THEN 'External'
WHEN coa.properties & 255 = 2 THEN 'Generated (artificial)'
WHEN coa.properties & 255 = 3 THEN 'External Generated (artificial)'
ELSE 'Unknown'
END
FROM ctt_object_applications coa
JOIN csv_file_objects cfo
ON cfo.object_id = coa.object_id
AND cfo.object_fullname IN (<'object_fullname1'>,
<'object_fullname2'>,
....,
<'object_fullnameN'>)
Query result example
"java.lang.String";"External"
“
“
Query result interpretation
java.lang.String is External
Default Package>.SelectQueries.myMethod is Internal
<Default Package>.SelectQueries.SelectQueries is Generated
Notes/comments
Related Pages