1

I have to compare 2 tables one from gdb and another from database. I do not want myself to do a comparison one by one. Do anyone of you have a better idea for doing this?

UPDATE: I have read the documentation. I have tried with the Table Compare. But the output came like this for the below scenario# Scenario 1) DB table does not have any data.

Has_error, Identifier, Message, Base_value, Test_value, ObjectID

"true", "Table", "Table row counts are different", "1734", "578", -1 "false", "Table", "Tables have same number of fields", " ", " ", -1

Scenario 2) DB table has data 1 time insert.

Has_error, Identifier, Message, Base_value, Test_value, ObjectID

"true", "Table", "Table row counts are different", "578", "2312", -1 "true", "Field", "TestField lengths are different", "8", "36", -1

"false", "Table", "Tables have same number of fields", " ", " ", -1 "false", "Table", "Rows are the same", " ", " ", -1

The field is a date field which I suppose differnt in GDB and Database thats why the field is updated in the file as I think. I may be wrong. But not sure what is the way to use this Table Compare in such cases.

  • Yes, its easy way to do so. Just say something more about your problem. – JuniorPythonNewbie Nov 21 '18 at 11:52
  • I have exported a dataset to gdb. After doing so I need to push the data to a table in database. But the point of comparison comes since gdb may be multiple but database table will not contain duplicate rows. I have to prevent it from entering into db and also needs to check if there ia an updation. – royan Nov 21 '18 at 12:33
  • what do you mean by compare? for a specific field, the number of rows... etc? can you provide more details? – NULL.Dude Nov 21 '18 at 12:35
  • Fields values except OID for all the rows of a table comapred with field values of all the rows in another table ...both tables OID needs not to be compared – royan Nov 21 '18 at 12:40
  • python set.difference can do this pretty quickly. docs.python.org/2/library/sets.html – NULL.Dude Nov 21 '18 at 14:06
1

The Table Compare tool should do the trick:

http://desktop.arcgis.com/en/arcmap/10.3/tools/data-management-toolbox/table-compare.htm

I can't see any specific info about reading databases, but a quick test had no issues reading a GeoDB so it should be fine once the data is in the Arc environment.

This second link is the archived help for version 10.1 which you have tagged as using: https://resources.arcgis.com/en/help/main/10.1/index.html#//001700000007000000

  • hey MAJ742, I have updated my question with what you suggested. Date fields are there in the input so always it mismatches from GDB to Database – royan Nov 21 '18 at 14:27
  • @royan Interesting, my immediate thought is have you checked the field type in both to see how the information is stored? If one is storing the date as a 'string' rather than 'number' or 'date' then they probably won't match. – MAJ742 Nov 21 '18 at 14:30
  • hey I checked the types in both case. In GDB it shows "Date" and in Database also they are Date. I am not sure if they way ArcGis interpret the date and the way db interprets the date are not simmilar. Why I am thinking that because it says the length of the type mismatches like in GDB it is "8", and in Database it is "36" – royan Nov 21 '18 at 14:35
  • hmm, I'd probably try adding new fields as string and importing the date values or equivalent as fixed text and retrying the compare. Hopefully that will then help narrow down if the error is caused by this join or something else. It might also help to convert eh database into a GeoDB as well, but hard to know without looking at it more! – MAJ742 Nov 21 '18 at 14:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.