Thanks Vince for prompt reply.
I'm not deleting table. GP Script user is not the owner of the table. So it can not create or delete schema. I'm just deleting existing features and inserting new one in exiting schema.
DeleteFeatures_management - deleting rows
arcpy.da.insertcursor - inserting rows
If I use CopyFeatures, FeatureClassToFeatureClass, Append management tools, output features show up correctly sorted on ObjectID. I can't use these tools in present case.(limitation in my scenario)
If same feature data set (i.e. same spatial extent) show up differently created by above two ways.
What's missing to show it up correctly?
Once you start using DELETE, the database is well within rights to place rows in any page it deems appropriate (each table has its own "high water mark" of previously allocated extents).
If you actually TRUNCATE the table instead of DELETE, then the rows would likely be placed in the order you inserted them (since the high water mark is cleared, and new blocks are being allocated)
It's important to know that the database is not obligated to return rows in any particular order unless an ORDER BY clause is used. Also, once the spatial extent reaches a quarter of the overall extent, spatial queries are likely to return features in spatial index order.
- V
Hi Vince
I found this post mostly matching to my issue. I'm using ArcGIS Version 10.2.2.
In my GP script, I deleted all old features from a FC using arcpy.DeleteFeatures_management.
and Inserted new features by using arcpy.da.insertcursor, record inserted in the correct order, I can see from auto generated object ids.
But on opening attribute table in ArcMAP or preview in ArcCatelog the table don't show records sorted on Object ID. I tried to rebuild indexes, set spatial index on FC using owner. It did not help
If I use CopyFeatures, FeatureClassToFeatureClass, Append management tools, features show up correctly sorted on ObjectID. In my GP scenario I'm not the owner of dataset/feature class. I'm working with another user having privilege to insert update delete records.
What's the difference. How I can see data on sorted order?
Thanks and Regards
Lalit Arora
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.