SQL Queries - CAST Knowledge Base - Queries on source code - How to get the source code for a given object id

Purpose of Query

Follow, the query used in the dashboard to get the source code for given object_id
The object_Id is displayed in URL of the viewer source page like following one : http://localhost:8888/CASTAD632_2/?object=10173&frame=FRAME_CODE_VIEWER&site=0#objectCode

Run the following query on your Local Database. <OBJECT_ID> is the object id for which you want to see the source code.

Applicable CAST Version

ReleaseYes/No
8.2.x
8.1.x
8.0.x
7.3.x
7.2.x
7.0.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS2
CSS1

Query for

SELECT   dsp.panel,
         dcs.source_path,
         dcs.source_code,
         dcs.source_error,
         dsp.line_start,
         dsp.line_end,
         dsp.col_start,
         dsp.col_end,
         o.fullname,
         k.objtyp,
         t.typnam
FROM     dss_source_positions dsp
JOIN     dss_code_sources dcs
ON       dcs.source_id = dsp.source_id
JOIN     keys k
ON       k.idkey = dsp.object_id
JOIN     objfulnam o
ON       o.idobj = k.idkey
JOIN     typ t
ON t.idtyp = k.objtyp
WHERE    dsp.object_id = <OBJECT_ID>
ORDER BY dsp.panel

Query result example

panel integer

source_path

character varying(600)

source_code text

source_error

character varying

line_start

integer

line_end

integer

col_start

integer

col_end

integer

full name

character varying(255)

objtyp

integer

typnam

character varying(255)

458C:\SBO - CAST\CAST-MS\735 FP05\Deploy\xxx FP05\MyPackage\xxxxx

/*

#Script Version

01077111203xxxxx817FORMS_RDF_MODULE

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