FdoIUpdate::Execute() and FdoIDelete::Execute() with Non-Spatial Query Return Wrong Row Count

FDO SDK

 
FdoIUpdate::Execute() and FdoIDelete::Execute() with Non-Spatial Query Return Wrong Row Count
 
 
 

Although these two methods operate correctly, they return the wrong row count with a non-spatial query; that is, they always return either 1 or 0, regardless of the context.

NoteThe correct row count is returned if the method is performed with a spatial query.

To obtain the row count, you can use either of the following workarounds, depending on the conditions specified in the workaround.

  • If the class has geometry properties, you can add an Intersects spatial filter to your FDO filter, where the spatial filter geometry is set to the extents of the spatial context for the FDO class being queried.
  • Do the following:
    1. Execute a Select command against the same FDO class that you will update or delete, using the same FDO filter.
    2. Count the rows returned by the Select command.
    3. Execute the Update or Delete command.
    NoteIf another user modifies the contents of the ArcSDE table between the time you do your Select command and your Update or Delete command, the result could still be an incorrect row count.