Okay. Utilize the connection string you've created to that version as the path that arcpy follows....
Be sure you read up on how Esri's versioning model operates. There is no difference between the child and parent versions if no editing has occurred. The active version is a connnection property.
- V
I have read the same and as you say active version is connection property but I am unable to get the path of the child version even I am trying to perform some operation let say arcpy.MakeFeatureLayer_management('path of child version feature class','any name for temporary new feature class')
I am getting an error
error 000732 does not exist or is not supported failed to execute
which clearly says I am unable to reach to my feature class for child version while the same operation happens when I give the path of default SDE version feature class [I just drag and drop in python Console of ArcMap, the feature class from SDE connection for a child and default version]
Is it a specific way to reach the path of child version?
Thank you for your time
You haven't provided enough useful information. What is the name of your user? What is the name of the version? From which version was the new version created. What exact parameter did you change on the connection UI?
- V
Hello Vince,
It seems I got the solution. Whenever I am trying to change the version of SDE I should restart the ArcMap and then I was able to get the path of child version
No, this is not part of the standard workflow.
- V
Hi Vince,
I know that's not the standard workflow. Let me explain to you my problem.
Let say I have many versions of particular SDE. Eg. Let say they are A,B,C, DEFAULT.
I dragged and dropped a particular feature class says MAIN from version DEFAULT.
1. I started editing mode on.
2. Selected some features in main
3. Now trying to read path of the selected features in MAIN in the following pythonic way.
mxd = arcpy.mapping.MapDocument("CURRENT")
layer = arcpy.mapping.ListLayers(mxd)
for i in layer:
print arcpy.Describe(i).catalogPath
This gives the result
Databaseconnection.sde\MAIN
4. Now I changed the version of the MAIN layer in TOC to let say Version A and applied the same above code to get the path of the Version A
This gives the result
MAIN
Conclusion
I am unable to fetch the exact path of the feature when trying to change the version in TOC from current version to some other version. This is halting me perform my other operations.
Can you kindly help me with getting the path of the feature class in a versioned SDE?
Thank you for your time
Jay Prakash Kumar
Hello Vince,
It was a bug that ESRI solved in 10.6
But still, I am looking for some alternative. If you could give some workaround then that will be helpful
Thank you for your time
Jay
The only alternate solution was given in the bug
Right-click the database connection, select Geodatabase Connection Properties, and point to the right version