Error: Underlying DBMS error[ORA-01795: maximum number of expressions in a list is 1000]
Using GetObjectsMatchingObjectSet, GetObjectsRelatedToObjectSet, and GetObjectsRelatedToObject on IRelationshipClass return the following error if the object has more than 1000 related objects:
Underlying DBMS error[ORA-01795: maximum number of expressions in a list is 1000]
This only occurs when the underlying database is Oracle.
Oracle limits the number of items in an 'in clause' to 1000 items. ArcGIS doesn't break up the 'in clause' into multiple queries when retrieving all the related objects.
Solution or Workaround
- If possible, upgrade to ArcGIS 9.0 or later where this is no longer a problem.
- If it is not possible to upgrade to 9.0, it is recommended that there are not more that 1000 objects related to a single object. If this can not be prevented, avoid these 3 method calls which fail.