1

New to the GIS world, but have a little background with Python. I'm attempting to compare an Access DB to a GDB and update the GDB for specific fields if there is a difference. I've read multiple places that updating a field like length or width directly with SQL can cause issues, so I wanted to make sure I'm using the appropriate modules to update the fields. I found a similar link below that is attempting to something similar, but I'm only wanting to update the differences in specific fields. The other issue is that the field columns are named differently, utilizing SQL I could just rename the column and match the values appropriately, but I haven't found any documentation stating that I can do the same with modules such as TableCompare_management, and join.

Just to confirm, can I not just compare each row from the access db by a unique ID to the GDB, and update the fields that are different? Or will that really break things?

  • 1
    What would break? Join (pro.arcgis.com/en/pro-app/tool-reference/data-management/…) them together and compare and update using da.UpdateCursor – BERA Mar 27 '18 at 13:26
  • There was a comment here: pro.arcgis.com/en/pro-app/arcpy/classes/arcsdesqlexecute.htm that stated " Enterprise geodatabase system tables should not be altered using anything other than ArcGIS software. Corruption can occur if these system tables are edited directly using SQL." I just assumed there was something going on in the background that I may not have been aware of that would cause corruption to the DB. – shane Mar 27 '18 at 15:33
  • What type of "GDB" are you using? – PolyGeo Mar 29 '18 at 4:19
  • It is an sde. I've seen so many different ways at handling this solution, I keep going around in circles. I seem to not be able to join the accessDB and SDE, as the Access DB does not meet the requirements of needed for a join (Mosaic Layer; Raster Layer; Table View) as of my understanding. Or perhaps going about it the wrong way. Is it possible to convert the accessDB into a table view utilizing MakeTableView_management module? – shane Mar 29 '18 at 21:05
  • Maybe I'm wrong as the MakeTableView_management module also requires a datatype of a "Table View". Perhaps the issue is is that I do not know how to properly reference the access DB table. Originally I intended on doing a pypyodbc.connect, create a cursor then interact with the access DB from there, but I'm thinking there is probably a better way than how I'm going about it. Does anyone have any good documentation on the syntax to connecting to these? I see it referenced in places like C:\database\test.mdb\table, but that doesn't seem to work for me. – shane Mar 29 '18 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.