Reconcile and Post Feature Layer Error with ArcPy?

1144
2
09-29-2016 01:50 PM
GeoffreyWest
Occasional Contributor III

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 = 'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde\SEU_GIS_GAS.Korterra\SEU_GIS_GAS.line_tickets_DEV'

mobiletable = r'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde\SEU_GIS_GAS.MobileIDs_District'

db = 'C:\\GIS Projects\\Korterra Script\\TEST_PORTAL_SCG.sde'

copiedFC = 'line_tickets_dev_joined'

fds = 'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde\SEU_GIS_GAS.Korterra'

Parent = "SDE.DEFAULT"

##print "Creating Version"
##arcpy.CreateVersion_management (r'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde', Parent, 'KorTerraVersionTest', "PUBLIC")

print "Creating Feature Layer"
arcpy.MakeFeatureLayer_management(linefc, "line_dev_layer")

print "Changing FC Version"
arcpy.ChangeVersion_management("line_dev_layer", 'TRANSACTIONAL', 'SEU_GIS_GAS.KorTerraVersionTest', '')

print "Creating Table View"
arcpy.MakeTableView_management(mobiletable, "MobileView")

print "Changing Table Version"
arcpy.ChangeVersion_management("MobileView", 'TRANSACTIONAL', 'SEU_GIS_GAS.KorTerraVersionTest', '')

print "Joining Fields"
arcpy.AddJoin_management("line_dev_layer", "MOBILEID", "MobileView", "Mobile")

##arcpy.FeatureClassToFeatureClass_conversion("line_dev_layer", fds, copiedFC)

arcpy.ChangeVersion_management('line_dev_layer', "TRANSACTIONAL", "SDE.DEFAULT", '')

print "Reconciling Versions"
arcpy.ReconcileVersions_management(db,"", "SDE.DEFAULT", 'SEU_GIS_GAS.KorTerraVersionTest', with_post = "POST", with_delete = "KEEP_VERSION" )

print "Done"
0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

not the problem but you are mixing your path formats... use 'raw' format

r'C:\GIS Projects\Korterra Script\TEST_PORTAL_SCG.sde\SEU_GIS_GAS.Korterra\SEU_GIS_GAS.line_tickets_DEV'

Now the interesting about tools, is unless they error out, they do as described... so if the tool does nothing, specifically not what you want, it is successful.  If it does something and it report results, it might be useful to collect and print those.

0 Kudos
DanPatterson_Retired
MVP Emeritus

on an after thought... If you were viewing and or had the inputs open, nothing would change until there was a 'refresh' performed.... or was nothing changed at all?

0 Kudos