Skip to main content
Solved

How to calculate the CRC for a database schema

  • April 26, 2018
  • 2 replies
  • 47 views

dollargis
Contributor
Forum|alt.badge.img+6

To compare database table structures, I try to calculate the CRC of the table schema like this.

However I seem to be unable to set the parameters for the crc calculator to do what I want. In the end I only need that one number of the CRC to compare it with the equally retrieved CRC of the same table in a different database

Best answer by david_r

The schema definition comes as a list attribute, which isn't really supported by the CRCCalculator. You can e.g. use a ListConcatenator to convert the list into a string for the CRCCalculator.

Note 1: If the schemas are identical but the attribute order differs, the CRC will also differ. You can use a ListSorter before the ListConcatenator to prevent this.

Note 2: If you haven't already, set the FeatureReader to read only the schema feature and not the data features, it will make a big difference in performance:

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 8394 replies
  • Best Answer
  • April 26, 2018

The schema definition comes as a list attribute, which isn't really supported by the CRCCalculator. You can e.g. use a ListConcatenator to convert the list into a string for the CRCCalculator.

Note 1: If the schemas are identical but the attribute order differs, the CRC will also differ. You can use a ListSorter before the ListConcatenator to prevent this.

Note 2: If you haven't already, set the FeatureReader to read only the schema feature and not the data features, it will make a big difference in performance:


dollargis
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 37 replies
  • April 26, 2018

@david_r: yes, like that it works fine. Thanks!