HOW TO
Instructions provided describe how to convert Oracle spatial SDO attributes to st_geometry attributes.
Example One
If the table with the st_geometry attribute is registered with the geodatabase, obtain the table's registration identifier to be used for the sequence to generate the ROWID value.
Code:
SQL> SELECT registration_id FROM sde.table_registry WHERE table_name = 'PARCELS_ST';
Code:
SQL> SELECT srid FROM sde.st_geometry_columns WHERE table_name = 'PARCELS_ST';
Code:
SQL> INSERT INTO parcels_st SELECT r121.nextval, sde.st_geomfromwkb(sdo_geometry.get_wkb(shape),3) FROM parcels_sdo;
As in the previous example, obtain the table's registration_id for the sequence name and the SRID value for the st_geomfromwkb spatial reference argument. The trigger is executed after every row that is inserted into the parcels_sdo table. If there are any errors during the execution of the trigger, the errors are ignored with the exception handler (this is to ensure the primary transaction is not impacted by the trigger specification).
Code:
CREATE OR REPLACE TRIGGER sdo_to_st AFTER INSERT ON parcels_sdo FOR EACH ROW
BEGIN
INSERT INTO parcels_st VALUES (r121.nextval, sde.st_geomfromwkb(sdo_geometry.get_wkb(:NEW.shape),3));
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
/
Get help from ArcGIS experts
Download the Esri Support App