I am aware that I can convert ORACLE SDO_GEOMETRY to WKT format. But, I don't know how to convert it if it contains multiple values. How do I do that?
I have the following table:
ID | SDO_GEOMETRY |
---|---|
1234 | SDO_GEOMETRY(2001, NULL, MDSYS.SDO_POINT_TYPE(9971, 19188, NULL), NULL, NULL) |
1235 | SDO_GEOMETRY(2001, NULL, MDSYS.SDO_POINT_TYPE(9972, 18282, NULL), NULL, NULL) |
1236 | SDO_GEOMETRY(2001, NULL, MDSYS.SDO_POINT_TYPE(9977, 19201, NULL), NULL, NULL) |
1237 | SDO_GEOMETRY(2001, NULL, MDSYS.SDO_POINT_TYPE(9993, 18225, NULL), NULL, NULL) |
1238 | SDO_GEOMETRY(2001, NULL, MDSYS.SDO_POINT_TYPE(10035, 18367, NULL), NULL, NULL) |
I would like to convert all these values to WKT at once. How do I do that? What I tried so far?
CREATE TABLE new_test ( name varchar2(20), geom SDO_GEOMETRY );
INSERT INTO new_test (name, geom)
VALUES (
'1234',
SDO_GEOMETRY(2001, NULL, MDSYS.SDO_POINT_TYPE(9971, 19188, NULL), NULL, NULL);
);
SELECT NAME, SDO_UTIL.TO_WKTGEOMETRY(GEOM) AS point FROM NEW_TEST;
The above script converts only one at a time. How do I implement that for multiple rows?
you could use SDO_UTIL.TO_WKTGEOMETRY("name_of_ur_geometry_column") as GEO_WKT an then save it to a csv,txt or whatever you need