1

I'm trying to append a feature class from a file geodatabase to an Arcsde featureclass using this line of code:

arcpy.Append_management("parcel_copy", sde_path+"parcel" ,"NO_TEST")

This line works under Python console in ArcMap , but when I execute it under Pyscripter IDE, all the code works fine except the append statement, and it does not return an error.


I have tried to isolate the append statements in a little script, and it worked, but i still don't understand why it has not worked.

i wonder if i have not deleted a featurelayer refering to a featureclass in SDE, that locks this featureclass, so i cannot append to it.

any explanation?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Oct 4, 2012 at 1:13
3
  • Consider using os.path.join to join the path and table name in a more robust way. Commented Oct 4, 2012 at 3:28
  • the feature classe "parcel_copy"is in the geodatabbase set in the workspace of arcpy, so i can access to this feature class. Commented Oct 4, 2012 at 7:26
  • You also may need an edit session open Commented Apr 24, 2018 at 18:53

1 Answer 1

4

"parcel_copy" appears to be a layer in the Table of Contents of your map, so will be found when you run the script from ArcMap.

However, in order to let the script (when run outside of ArcMap) know where the data that layer is based on can be found, you will need to either issue MakeFeatureLayer before the Append, or more simply reference the path to the dataset in place of the layer name of the Append.

answered Oct 4, 2012 at 1:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.