wtorek, 1 marca 2011

How to select value of SDO_GEOMETRY Object

http://download.oracle.com/docs/cd/E11882_01/appdev.112/e11830/sdo_objrelschema.htm#i1004087

States:

"Oracle Spatial defines the object type SDO_GEOMETRY as:

CREATE TYPE sdo_geometry AS OBJECT (
 SDO_GTYPE NUMBER,
 SDO_SRID NUMBER,
 SDO_POINT SDO_POINT_TYPE,
 SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY,
 SDO_ORDINATES SDO_ORDINATE_ARRAY);
"

Let's assume we have a "TABLE" with SDO_GEOMETRY Type field named "GEOM".
If you want to get the values of certain SDO_GEOMETRY Type field and make query like this:

select geom.SDO_GTYPE from table;

You'll get ORA-00904 Error: "invalid identifier".

Try with table name alias:

select t.geom.SDO_GTYPE from table t;

GEOM.SDO_GTYPE   
----------------------
2003      

Brak komentarzy:

Prześlij komentarz