Select to view content in your preferred language

arcpy.CopyFeatures_management, SDE, and schema with underscores

1242
2
09-28-2011 09:22 AM
JanicePoehlman
Emerging Contributor
The best that I can narrow down is that my script is failing because of underscores in my SDE schema names. (All other schemas & tablespaces, both spatial and tabular, without underscores run through the process just fine.)

The error returned to the python shell:
"ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset X222_TRN_MST.GIS_POINTS
does not exist or is not supported"

I have multiple SDE environments and am using multiple SDE connection files for various schemas --all that work fine, EXCEPT the schema that includes an underscore.

Anyone have a workaround? I'm not going to convince my DBA to change the schema name.
Tags (2)
0 Kudos
2 Replies
MathewCoyle
Honored Contributor
What code is failing? Have you tried FeatureClassToFeatureClass_conversion tool? Are you using the right keyword?
0 Kudos
JanicePoehlman
Emerging Contributor
pubschema = parameters["SDEpub"]   #input from parameters file
sdenv = parameters["env"]  #input from parameters file
pubDEVbugeo = "SDE"+sdenv+"_"+str(date.today()) + "_BU_" +pubschema+ "gdb"  #construct name
f2 = open(feat_class_pub) #open text file
    while 1:
        sLine = f2.readline() #read text file
        if not sLine: break
        arcpy.CopyFeatures_management(pubschema+sLine, outputdir+"/"+env+"/"+sLine) #copy to new
I'm using an SDE connection file, a copy of the exact one that is used to connect to SDE through ArcCatalog on the same computer.  I shouldn't think this would be an issue (it's not for other connection files or this one in AC) and the keyword is in the connection file but I will take a look.

The script syntax works but balks on schema names that include an underscore.  Might be barking up the wrong tree but it's a place to start.
Thanks.
0 Kudos