This discussion is archived
3 Replies Latest reply: Jun 16, 2006 7:50 AM by Siva Ravada RSS

Problem with TO_WKTGEOMETRY/FROM_WKTGEOMETRY

515890 Newbie
Currently Being Moderated
Hello everyone

I've installed Oracle 10g XE and I'm trying to use the geometry functions as described in OGC's Simple Features for SQL Spec. (see http://www.opengis.org/docs/99-049.pdf ), but they don't seem work. Is this a bug or is there a mistake in my SQL??

**************************************************************************************************
SQL> CREATE TABLE spatial ( id int, g SDO_GEOMETRY );

Tabelle wurde erstellt.

SQL> INSERT INTO spatial VALUES( 1, SDO_GEOMETRY(2001, 1, SDO_POINT_TYPE(1, 1, NULL), NULL, NULL) );

1 Zeile wurde erstellt.

SQL> INSERT INTO spatial VALUES( 2, SDO_UTIL.FROM_WKTGEOMETRY( 'POINT(2 2)' ) );

1 Zeile wurde erstellt.

SQL> SELECT COUNT(*) FROM spatial;

COUNT(*)
----------
2

SQL> SELECT * FROM spatial;

ID
----------
G(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
--------------------------------------------------------------------------------
1
SDO_GEOMETRY(2001, 1, SDO_POINT_TYPE(1, 1, NULL), NULL, NULL)

2



SQL> SELECT g FROM spatial WHERE id = 2;

G(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
--------------------------------------------------------------------------------


SQL> SELECT id, SDO_UTIL.TO_WKTGEOMETRY( g ) FROM spatial;

ID
----------
SDO_UTIL.TO_WKTGEOMETRY(G)
--------------------------------------------------------------------------------
1


2


SQL>
**************************************************************************************************


Thanks and bye..
Thomas