SQL Queries - CAST Knowledge Base - Queries on objects - How to get the algebraic representation of the object position on the source file

Purpose of Query

The query returns the line start, column start, line end and column end of an object

Applicable CAST Version

ReleaseYes/No
8.3.x
8.2.x
8.1.x
8.0.x

Applicable RDBMS

RDBMSYes/No
Oracle Server
Microsoft SQL Server
CSS2

Query for CSS

SELECT SP.line_start, 
       SP.col_start, 
       SP.line_end, 
       SP.col_end
FROM   dss_source_positions SP 
       JOIN dss_code_sources CS 
         ON CS.source_id = SP.source_id 
       JOIN objfulnam k 
         ON k.idobj = SP.object_id 
            AND k.fullname = 'name of the objects'

Query result example

20;6;20;19

Query result interpretation

The query returns the line start, column start, line end and column end

Query for Oracle

SELECT SP.line_start, 
       SP.col_start, 
       SP.line_end, 
       SP.col_end
FROM   dss_source_positions SP 
       JOIN dss_code_sources CS 
         ON CS.source_id = SP.source_id 
       JOIN objfulnam k 
         ON k.idobj = SP.object_id 
            AND k.fullname = 'name of the objects'

Query result example

20;6;20;19

Query result interpretation

The query returns the line start, column start, line end and column end

Query for SQL server

SELECT SP.line_start, 
       SP.col_start, 
       SP.line_end, 
       SP.col_end
FROM   dss_source_positions SP 
       JOIN dss_code_sources CS 
         ON CS.source_id = SP.source_id 
       JOIN objfulnam k 
         ON k.idobj = SP.object_id 
            AND k.fullname = 'name of the objects'

Query result example

20;6;20;19

Query result interpretation

The query returns the line start, column start, line end and column end

Notes/comments

Related Pages