SQL Queries - CAST Knowledge Base - Queries on objects - How to get the object types calling a specific object type
Purpose of Query
The purpose of this page is to provide a query which is run on the CAST Knowledge Base which provides all of the object types calling another specific object type. For example, if you want to see the object types (such as VB Function, Java Method) that are calling an Oracle table, then this query can be used for that purpose.
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
To get the list of all object types in the KB, run the following query:
SELECT COUNT(*),
object_type_str
FROM cdt_objects
GROUP BY object_type_str;
Query result example
58;“VB Function”
82;“VB External Function”
Query result interpretation
The count of objects of each technology type is provided
This type can then be used in the following query to determine the other types which are calling this object type. For example, for VB function, use the following query (the value for callee.object_type_str can be modified for the object type desired to be examined):
Select distinct
caller.object_type_str CALLERS
from cdt_objects caller, cdt_objects callee, ctv_links caller_callee
where caller.object_id = caller_callee.caller_id
and callee.object_id = caller_callee.called_id
and callee.object_type_str = 'VB Function';
Query result example
“VB Event”
“VB Sub”
“VB Property Get”
“VB Function”
Query result interpretation
The technology types calling the provided technology will then be listed. In the example above, the technology types calling the VB function in the KB queried are VB Event, VB Sub, VB Property Get, and VB function.
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