I have a table in an Oracle ArcSDE database where I have joined a feature layer and a table view, the resulting data set is a feature layer with fields from both datasets.
In my script I use a version of the database to make the feature layer from the feature class and execute the join. The join could not be executed due to a locked schema, so I took this route.
I would like to simply reconcile and post the joined feature layer to my SDE.DEFAULT version.
My code below shows my script so far. It does not return any errors; however the "line_dev_layer" and 'aVersion' are not reconciled and posted back to "SDE.DEFAULT".
When I execute the script in ArcGIS for Desktop the TableView and the Feature Layer join successfully. Additionally, the reconcile returns as successful too.
What could be the cause of this? No errors are returned when I run this script standalone or in the Python window in ArcGIS for Desktop.
linefc <SPAN class="operator token">=</SPAN> <SPAN class="string token">'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde\SEU_GIS_GAS.Korterra\SEU_GIS_GAS.line_tickets_DEV'</SPAN>
mobiletable <SPAN class="operator token">=</SPAN> r<SPAN class="string token">'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde\SEU_GIS_GAS.MobileIDs_District'</SPAN>
db <SPAN class="operator token">=</SPAN> <SPAN class="string token">'C:\\GIS Projects\\Korterra Script\\TEST_PORTAL_SCG.sde'</SPAN>
copiedFC <SPAN class="operator token">=</SPAN> <SPAN class="string token">'line_tickets_dev_joined'</SPAN>
fds <SPAN class="operator token">=</SPAN> <SPAN class="string token">'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde\SEU_GIS_GAS.Korterra'</SPAN>
Parent <SPAN class="operator token">=</SPAN> <SPAN class="string token">"SDE.DEFAULT"</SPAN>
<SPAN class="comment token">##print "Creating Version"</SPAN>
<SPAN class="comment token">##arcpy.CreateVersion_management (r'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde', Parent, 'KorTerraVersionTest', "PUBLIC")</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Creating Feature Layer"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>MakeFeatureLayer_management<SPAN class="punctuation token">(</SPAN>linefc<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"line_dev_layer"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Changing FC Version"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>ChangeVersion_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"line_dev_layer"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'TRANSACTIONAL'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SEU_GIS_GAS.KorTerraVersionTest'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Creating Table View"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>MakeTableView_management<SPAN class="punctuation token">(</SPAN>mobiletable<SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"MobileView"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Changing Table Version"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>ChangeVersion_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"MobileView"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'TRANSACTIONAL'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SEU_GIS_GAS.KorTerraVersionTest'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Joining Fields"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>AddJoin_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"line_dev_layer"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"MOBILEID"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"MobileView"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"Mobile"</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">##arcpy.FeatureClassToFeatureClass_conversion("line_dev_layer", fds, copiedFC)</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>ChangeVersion_management<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'line_dev_layer'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"TRANSACTIONAL"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"SDE.DEFAULT"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">''</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Reconciling Versions"</SPAN>
arcpy<SPAN class="punctuation token">.</SPAN>ReconcileVersions_management<SPAN class="punctuation token">(</SPAN>db<SPAN class="punctuation token">,</SPAN><SPAN class="string token">""</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">"SDE.DEFAULT"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">'SEU_GIS_GAS.KorTerraVersionTest'</SPAN><SPAN class="punctuation token">,</SPAN> with_post <SPAN class="operator token">=</SPAN> <SPAN class="string token">"POST"</SPAN><SPAN class="punctuation token">,</SPAN> with_delete <SPAN class="operator token">=</SPAN> <SPAN class="string token">"KEEP_VERSION"</SPAN> <SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">print</SPAN> <SPAN class="string token">"Done"</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>