gp.MakeFeatureLayer(r"conn.sde/schema.fc", "flyr", vSqlStmnt) gp.delete_management("flyr")
Delete simply wipes the entire dataset, so you don't want that. If you're sure you've got the SQL right and it will select the correct features, then you should be able to run Delete Features straight on the feature class (once you've made the selection). My understanding for making the feature layer is so you're working on a copy. You can then overwrite the original feature class or save the layer to a new feature class.
Should I create a feature layer, make a selection by attributes, then run delete_management or would I still need to use deletefeatures?
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.