SQL Queries - CAST Knowledge Base - Queries on source code - How to get the source code of an object
Purpose of Query
The query returns the source code of the file containing the object
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
SELECT source_code
FROM objfulnam k
JOIN objfilref obj
ON k.idobj= obj.idobj
JOIN refpath refp
ON refp.idfilref = obj.idfilref
JOIN dss_code_sources dcs
on dcs.source_path = refp.path
WHERE k.fullname = '<fullname of the objects>'
Query result example

Query result interpretation
The query returns the source code of the file containing the object
Query for Oracle
SELECT source_code
FROM objfulnam k
JOIN objfilref obj
ON k.idobj= obj.idobj
JOIN refpath refp
ON refp.idfilref = obj.idfilref
JOIN dss_code_sources dcs
on dcs.source_path = refp.path
WHERE k.fullname = '<fullname of the objects>'
Query result example

Query result interpretation
The query returns the source code of the file containing the object
Query for SQL server
SELECT source_code
FROM objfulnam k
JOIN objfilref obj
ON k.idobj= obj.idobj
JOIN refpath refp
ON refp.idfilref = obj.idfilref
JOIN dss_code_sources dcs
on dcs.source_path = refp.path
WHERE k.fullname = '<fullname of the objects>'
Query result example

Query result interpretation
The query returns the source code of the file containing the object
Notes/comments
Related Pages