My Oracle Support Banner

HC:SDO_relate Function Fails With Database Link - ORA-14551: Cannot perform DML operation within a query (Doc ID 2823259.1)

Last updated on JANUARY 28, 2022

Applies to:

Oracle Database - Enterprise Edition - Version and later
Information in this document applies to any platform.


In a given test package a Test2 fails, because the sdo_relate function returns nothing found. There is an identical Test1 which contains a dummy select, thus sdo_relate works fine.

In the debug window we get for the sdo_relate function, now following errorcode (the sdo_geom.relate function works):


ORA-29902: Error while executing routine ODCIIndexStart ()
ORA-13200: Internal error [ODCIIndexStart] during spatial indexing.
ORA-13249: INSERT INTO "MDSYS". "SDO_DIST_METADATA_TABLE" VALUES (: sdo_index_owner,: sdo_index_name,: sdo_partition_name,: txnid,: sdo_tsname,: sdo_table_name,: is_geodetic, . del_bb_start4,: del_bb_end4,: ins_no,: del_no)
ORA-29400: Data Cartridge Error
ORA-14551: Cannot perform DML operation within a query
ORA-06512: in "MDSYS.SDO_INDEX_METHOD_10I", line 591
ORA-06512: in "HR.TEST_PACKAGE", line 88
ORA-06512: in line 2


The dummy select that acts as a workaround for Test1:


  t_dummyCount integer;


  select 1

  into t_dummyCount

  from dual@SECONDDB;


The slower function sdo_geom.relate returns for both tests the correct result.






To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.