I have two geodatabases, one with February data (Final_Project_2.gdb) which contains 6 feature classes. The second geodatabase has March data, (Clipped.gdb), which also contains 6 feature classes, the same ones' as the first one, except some of the feature classes attribute tables have been updated. I have been trying to run the Table Compare tool in ArcGIS Pro, but as a python script, and just can't get it. In reality I just want to get the row count from each table in each feature class from the new database and compare it to the row count of each table in each feature class to the old database and see which feature class was updated/changed, so that the GIS library can be updated accordingly.
I've ran the tool in ArcGIS Pro and can do it one by one, by I would like to do like a loop, and go from GDB1 to GDB2, and if they are == (no change), skip, but if there is a change, print out the Name.
This is a script I tried but got an error:
clippedGBD = r"C:\GIS6340\Final_Project_GIS6340\FC_03132022\ClippedFC\ClippedGDB.gdb" in_base_table = r"C:\GIS6340\Final_Project_GIS6340\FC_03132022\ClippedFC\ClippedGDB.gdb" in_test_table = r"C:\GIS6340\Final_Project_2\Final_Project_2.gdb" sort_field = "OBJECTID" compare_type = "ALL" ignore_option = "IGNORE_EXTENSION_PROPERTIES" attribute_tolerance = "None" omit_field = "ALL" continue_compare = "CONTINUE_COMPARE" compare_file = "C:\GIS6340\Final_Project_GIS6340\FC_03132022\ClippedFC\Compared.cvs" compare_result = arcpy.TableCompare_management( in_base_table, in_test_table, sort_field, compare_type, ignore_option, attribute_tolerance, omit_field, continue_compare, compare_file)
Error: Traceback (most recent call last): File "", line 14, in File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 2023, in TableCompare raise e File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 2020, in TableCompare retval = convertArcObjectToPythonObject(gp.TableCompare_management(*gp_fixargs((in_base_table, in_test_table, sort_field, compare_type, ignore_options, attribute_tolerances, omit_field, continue_compare, out_compare_file), True))) File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing_base.py", line 512, in return lambda *args: val(*gp_fixargs(args, True)) arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid. ERROR 000732: Input Base Table: Dataset C:\GIS6340\Final_Project_GIS6340\FC_03132022\ClippedFC\ClippedGDB.gdb does not exist or is not supported ERROR 000732: Input Test Table: Dataset C:\GIS6340\Final_Project_2\Final_Project_2.gdb does not exist or is not supported ERROR 000893: An empty GP value or text is entered. Failed to execute (TableCompare).