<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SDE version editing with arcpy in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743229#M41848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to set up a way to edit a table and a feature class in versions of an SDE database.&amp;nbsp; The version is a parameter in a tool.&amp;nbsp; I must be missing a step, because I am not getting the Change Version function to work for any of my registered tables or the feature class.&amp;nbsp; Not even by converting the table to table view or the feature class to a feature layer.&amp;nbsp; The problem may be with the path.&amp;nbsp; Here is what I think should work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;out_gdb=r"T:\GIS\tools\SDE_Connection\CO_Stip_User.sde"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;abstractTbl=os.path.join(out_gdb,"ilmco.ILMCODBO.Abstract")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeTableView_management (plssTbl, "plss_2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ChangeVersion_management("plss_2", "TRANSACTIONAL", version_name)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;minerals=os.path.join(out_gdb,"ilmco.ILMCODBO.Minerals")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(minerals,"minerals_2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ChangeVersion_management("minerals_2", "TRANSACTIONAL", version_name)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The user versions are accessed through CO_Stip_User.sde.&amp;nbsp; The original database name is ilmco.&amp;nbsp; I've tried all sorts of combinations, but nothing is working!&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sarah&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Dec 2013 22:01:26 GMT</pubDate>
    <dc:creator>SarahDoyle</dc:creator>
    <dc:date>2013-12-05T22:01:26Z</dc:date>
    <item>
      <title>SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743229#M41848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to set up a way to edit a table and a feature class in versions of an SDE database.&amp;nbsp; The version is a parameter in a tool.&amp;nbsp; I must be missing a step, because I am not getting the Change Version function to work for any of my registered tables or the feature class.&amp;nbsp; Not even by converting the table to table view or the feature class to a feature layer.&amp;nbsp; The problem may be with the path.&amp;nbsp; Here is what I think should work:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;out_gdb=r"T:\GIS\tools\SDE_Connection\CO_Stip_User.sde"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;abstractTbl=os.path.join(out_gdb,"ilmco.ILMCODBO.Abstract")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeTableView_management (plssTbl, "plss_2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ChangeVersion_management("plss_2", "TRANSACTIONAL", version_name)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;minerals=os.path.join(out_gdb,"ilmco.ILMCODBO.Minerals")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(minerals,"minerals_2")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.ChangeVersion_management("minerals_2", "TRANSACTIONAL", version_name)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The user versions are accessed through CO_Stip_User.sde.&amp;nbsp; The original database name is ilmco.&amp;nbsp; I've tried all sorts of combinations, but nothing is working!&amp;nbsp; Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sarah&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 22:01:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743229#M41848</guid>
      <dc:creator>SarahDoyle</dc:creator>
      <dc:date>2013-12-05T22:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743230#M41849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Right, I'm not sure that you can change versions ON the actual table view and feature layer.&amp;nbsp; From the looks of your code, why not set the version when making the initial connection?&amp;nbsp; In other words, as an alternative you may be able to edit the .SDE connection file using arcpy, specifically the Transactional Version part of the connection side.&amp;nbsp; If the Transactional Version is a variable, you could use that variable in a For or While loop so that you can iterate through all of the versions you care about when making the edits you need.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2013 23:23:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743230#M41849</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2013-12-05T23:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743231#M41850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, I guess I'm not sure about how to connect to the Transactional version (its not really a path).&amp;nbsp; Is this what you had in mind?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;out_gdb=r"T:\GIS\tools\SDE_Connection\CO_Stip_User.sde"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;versions = arcpy.ListVersions(out_gdb)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for orig_version in versions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while orig_version == version:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minerals=os.path.join(out_gdb,"ilmcostip.ILMCODBO.Minerals")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then whatever edits I make to minerals will only be in that version?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 13:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743231#M41850</guid>
      <dc:creator>SarahDoyle</dc:creator>
      <dc:date>2013-12-06T13:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743232#M41851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, that is basically what I was referring to.&amp;nbsp; But since you would be looping through each version, the edits would be performed in all versions that you're looping through not just one.&amp;nbsp; Is that not your goal based on what you wrote?&amp;nbsp; Another possibility is to forget changing the version and instead simply deleting and re-creating the SDE connection file with the version you want as a parameter.&amp;nbsp; You can do that in arcpy too.&amp;nbsp; Either way, you will need to loop through your versions to make the same edits in all of them.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 13:41:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743232#M41851</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2013-12-06T13:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743233#M41852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't want to edit every version, just the one chosen by a user as a tool parameter.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't know about arcpy.CreateArcSDEConnectionFile_management.&amp;nbsp; I can only find references about it for 10.0.&amp;nbsp; If that works in 10.1, that might be the best way to go.&amp;nbsp; Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 13:58:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743233#M41852</guid>
      <dc:creator>SarahDoyle</dc:creator>
      <dc:date>2013-12-06T13:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743234#M41853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm, after creating the SDE connection, all of my edits are going to the default feature class and not the version.&amp;nbsp; Do I still have to change versions for each feature class/table?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 16:12:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743234#M41853</guid>
      <dc:creator>SarahDoyle</dc:creator>
      <dc:date>2013-12-06T16:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743235#M41854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you set the version in the newly-created SDE connection file, all of the tables and feature classes you edit using that connection file should honor the specified version.&amp;nbsp; I'm not sure why it would edit the DEFAULT version if you're providing a valid version name.&amp;nbsp; It &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;could&lt;/SPAN&gt;&lt;SPAN&gt; be a bug at 10.0 but I'm not sure.&amp;nbsp; Do some searching online for any related bugs that might already be know.&amp;nbsp; Otherwise, I'd recommend opening a support ticket with Esri.&amp;nbsp; Sorry I couldn't help!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 16:56:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743235#M41854</guid>
      <dc:creator>WilliamCraft</dc:creator>
      <dc:date>2013-12-06T16:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743236#M41855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sarah --&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your descriptions of what you're attempting don't match the vocabulary of Esri geodatabases,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; e.g.,&amp;nbsp; "all of my edits are going to the default feature class and not the version".&amp;nbsp; There isn't a&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"default feature class" (you always have to specify one), and all versioned edits have to take &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;place in *some* version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It might help to go back and brush up on the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/A_quick_tour_of_versioning/003n000000t7000000/"&gt;versioning documentation&lt;/A&gt;&lt;SPAN&gt;. You may also want to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;review Derek's &lt;/SPAN&gt;&lt;A href="http://www.esri.com/news/arcuser/0110/versioning101.html"&gt;Versioning 101&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When it comes down to simplest representation, a version is just the name of a state in the&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; state tree.&amp;nbsp; The state tree spans all tables within the geodatabase &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;as one entity. &lt;/SPAN&gt;&lt;SPAN&gt;Some states&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; could span multiple tables.&amp;nbsp;&amp;nbsp; It's a complex implementation, but the end-user experience has &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;only one moving part -- the version.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Each connection allows you to determine what your base version is, and each edit session&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;allows you to change the active version.&amp;nbsp; Changes made to a version advance the state&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and label it with the target version.&amp;nbsp; Further edits update the target version's state,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;leaving behind intermediate states, which can be compressed, and potentially conflicting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;state changes need to be reconciled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For your task, I believe you need only identify the table to updated, the base version from &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;which you want to edit (the default is SDE.DEFAULT), and the name of the version which &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;will label your completed edits.&amp;nbsp; Scripting this in Python probably shouldn't be your initial&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;attempt at the process.&amp;nbsp; Once you get comfortable with the use cases you'll probably find&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the process more intuitive.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Dec 2013 19:08:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743236#M41855</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2013-12-06T19:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: SDE version editing with arcpy</title>
      <link>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743237#M41856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help, but I figured out my issue.&amp;nbsp; There is a bug in 10.1 changing versions for table views.&amp;nbsp; Creating a new connection file is the only way to change the version in python.&amp;nbsp; It is fixed in 10.2.&amp;nbsp; Here is a link to the thread talking about the bug: &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/54905-Changing-Versions-with-Python"&gt;http://forums.arcgis.com/threads/54905-Changing-Versions-with-Python&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 13:54:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/sde-version-editing-with-arcpy/m-p/743237#M41856</guid>
      <dc:creator>SarahDoyle</dc:creator>
      <dc:date>2013-12-12T13:54:09Z</dc:date>
    </item>
  </channel>
</rss>

