Select to view content in your preferred language

how to get the lat and long from feature table in Oracle DB

Jump to solution
06-14-2024 05:40 AM
Labels (1)
New Contributor III

Hi I heard that in MS SQL, we can do the following

select shape, shape.STX as LONG, shape.STY as LAT from sde.fc

If my Geodatabase is in Oracle, and how can I get the STX and STY from the shape column. I tried the above and it return 

ORA-00904: "SHAPE"."STX": invalid identifier
00904. 00000 - "%s: invalid identifier"


0 Kudos
1 Solution

Accepted Solutions
3 Replies
Esri Notable Contributor
New Contributor III

Thanks. I am able to do as below

select sde.st_x(shape) from fc

0 Kudos
Esri Esteemed Contributor

Note that you should never store user data in the SDE schema, so the "from sde.fc" part is a problem. Best practice is to create a new login to own spatial data (and a new tablespace to store the data for that login).  Using the SDE login for this is akin to using SYSTEM or DBO for noodling, or web surfing the dark net as administrator -- It's not likely to end well.

- V