Listers,

This is off topic, but I need a little help constructing a TSQL statement
that uses the SDO_UNION geometry function in Oracle Spatial.  I have a
collection of polygons with a common ID and I need to merge the results into
a single polygon...somewhat akin to the Combine Objects Using Column
function in MapInfo Pro.

It appears that I have to use a cursor but how best to implement it, I have
no idea.  This is what the table looks like:

ID                    MI_PRINX                    GEOLOC
--                    -------------                    -----------
130                  1                                     Obj
130                  2                                     Obj
130                  3                                     Obj
130                  4                                     Obj
131                  5                                     Obj
131                  6                                     Obj

The result should be a table w/ 2 objects (130 & 131).

I've made it this far:

INSERT INTO new_table (ID, GEOLOC) VALUES (SELECT a.id,
SDO_GEOM.SDO_UNION(a.geoloc, m.DIMIMFO, a.geoloc, m.DIMINFO) FROM table_a,
user_sdo_geom_metadata m WHRE m.table_name = 'table_a' and m.column_name =
'geoloc')

Problem is, the a.geoloc is ambiuous as Oracle will only allow the UNION of
2 objects, not a recordset.  Any help...any suggestions...are most welcome!

- Ian Erickson


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 5503

Reply via email to