SQL Queries - CAST Knowledge Base - Queries on objects - How to find out if database objects belong to the same extraction

Purpose of Query

The purpose of the query is to find out if two objects belong to the same database extraction. If the results of the query are two identical lines, then they belong to the same extraction.

Applicable CAST Version
Release
Yes/No
8.3.x (tick)
8.2.x (tick)
8.1.x (tick)
8.0.x (tick)
Applicable RDBMS
RDBMS
Yes/No
Oracle Server (tick)
Microsoft SQL Server (tick)
CSS2 (tick)
Query for CSS
SELECT reverse(substring(Reverse(rp.path),position ('\' IN reverse(rp.path)))) 
FROM   refpath rp 
JOIN   objfilref ofr 
ON     ofr.idfilref = rp.idfilref 
WHERE  ofr.idobj IN (<object_id_1>, 
                     <object_id_2>)
Query result example

"S:\Sources\DB\APP\"
"S:\Sources\DB\APP\"

Query result interpretation
 The objects are from the same Database extraction because the two lines are identical
Query for Oracle
SELECT reverse(substring(Reverse(rp.path),position ('\' IN reverse(rp.path)))) 
FROM   refpath rp 
JOIN   objfilref ofr 
ON     ofr.idfilref = rp.idfilref 
WHERE  ofr.idobj IN (<object_id_1>, 
                     <object_id_2>)
Query result example
"S:\Sources\DB\APP\"
"S:\Sources\DB\APP\"
Query result interpretation
  The objects are from the same Database extraction because the two lines are identical
Query for SQL server
SELECT reverse(substring(Reverse(rp.path),position ('\' IN reverse(rp.path)))) 
FROM   refpath rp 
JOIN   objfilref ofr 
ON     ofr.idfilref = rp.idfilref 
WHERE  ofr.idobj IN (<object_id_1>, 
                     <object_id_2>)
Query result example
"S:\Sources\DB\APP\"
"S:\Sources\DB\APP\"
Query result interpretation
   The objects are from the same Database extraction because the two lines are identical
Notes/comments