Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I want to be able to control connections to ArcSDE via python. Here is my script so far using ESRI's example.

import arcpy
from arcpy import env
env.workspace = r"SDEConnection" 
fcList = arcpy.ListFeatureClasses()
print str(fcList) + "\n"
env.workspace = "" 
arcpy.ClearWorkspaceCache(r"SDEConnection")
print arcpy.GetMessages() + "\n"

But this isnt working .. it crashes my Python window :(

share|improve this question
1  
Where did you get the sample from? Providing a link would be helpful. – RyanDalton Sep 13 '12 at 15:27
And i just noticed the syntax in that site says ClearWorkspaceCache_management.. but in the example it doesnt.. hmm im going to try with the 'management' on the end now.. i will let you know what the outcome is – Kam Sep 13 '12 at 15:47
Oh, it seems it is all ESRI's fault! In their example on the helpdesk they have got the syntax wrong. Excluding the word 'management' from the end of 'ClearWorkspaceCache' I corrected my script to read > arcpy.ClearWorkspaceCache_management(r"SDEConnection") – Kam Sep 13 '12 at 16:11
2  
@Kam- Since you answered your own question, please put the above comment into the answer area and, in a couple of days, you should be able to mark your question as accepted. I would suggest updating your code with the corrected syntax. – RyanDalton Sep 13 '12 at 20:28
show 1 more comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.