I want to access the feature class of my newly created Versioned dataset (child) created from the default SDE using arcpy
Thank you for your time
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.
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?
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?
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.
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:
This gives the result
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
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?
Jay Prakash Kumar
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
The only alternate solution was given in the bug
Right-click the database connection, select Geodatabase Connection Properties, and point to the right version
Thanks, Dan, But that too works for 10.4 and onwards. I need this to mainly implement on 10.2 and 10.3. I am thinking something out of box. This could be something like making python addin that will detect the path. Something like that...I am just trying some way...
connection string changes (which is wrong) when I change my SDE to child version, while it's correct when from the default SDE
Retrieving data ...