I have an SDE.ST_GEOMETRY value (Oracle 18c):
select
sde.st_geometry('LINESTRING EMPTY', 26917) as shape
from
dual
I want to select one of the ST_GEOMETRY object's attributes:
How can I do that with Oracle SQL?
1. Use dot notation:
select
sde.st_geometry('LINESTRING EMPTY', 26917).len as shape
from
dual
If the shape column wasn't already wrapped in brackets via a function, then we would need to add the brackets:
select
(shape).len
from
my_fc
2. Or, use a table alias:
select
a.shape.len
from
my_fc a
3. Or, use the TREAT() function:
select
treat(shape as sde.st_geometry).len
from
my_fc
Although that might be misguided/unnecessary, since wrapping the column in brackets achieves the same thing (brackets is my preferred technique).
If I understand correctly, SDO_GEOMETRY has similar attributes. Additionally, SDO_GEOMETRY has methods (aka member functions):
Techniques for selecting an object's attribute
Replace value in SDO_ELEM_INFO_ARRAY varray
Modify SDO_ELEM_INFO_ARRAY of existing geometry
For my notes, the result from an object's attribute can be different than the result from the corresponding ST_GEOMETRY function: