English

Error: ORA-20085: Insert Spatial Reference SRID 7 does not match

Error Message

Transforming st_geometry attributes from one spatial reference to another with the st_transform operator when the attribute is spatially indexed fails with the following error:

Code:
ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
ORA-20085: Insert Spatial Reference SRID 7 does not match


The following example illustrates the complete error stack:

Code:
SDL> UPDATE parcels SET shape = sde.st_transform(shape,7);

*
ERROR at line 1:
ORA-29877: failed in the execution of the ODCIINDEXUPDATE routine
ORA-20085: Insert Spatial Reference SRID 7 does not match
TB.PARCELS.SHAPE registered Spatial Reference SRID 6
ORA-06512: at "SDE.ST_DOMAIN_METHODS", line 1413
ORA-06512: at "SDE.ST_DOMAIN_METHODS", line 1740

Cause

Executing the st_transform operator against an st_geometry attribute that is indexed fails because the operator is attempting to update the geometry and spatial index with a new spatial reference identifier that does not match the index's current spatial reference identifier.

Solution or Workaround

Drop the spatial index prior to updating the st_geometry attribute.

Drop the spatial index.

Code:
SQL> DROP INDEX parcels_shape_idx;

Index dropped.

Next, execute the transformation using the st_transform operator.

Code:
SQL> UPDATE parcels SET shape = sde.st_transform(shape,5);

Create the spatial index on the attribute.