Skip to main content
Solved

How to compare column names(tables) for two shp to see if a column has been added or removed?

  • June 29, 2018
  • 3 replies
  • 118 views

john_esk
Contributor
Forum|alt.badge.img+7

Hey!

I have created a workspace that downloads a zip file containing a shp everytime the data has been updated. I now want to compare the shp in the zip file with the older shp on a ArcSDE database to see if a column has been added or removed. I have tried using a FeatureReader to read the shp in the zip but I don't know how to do the comparising step. The goal is to get notified via the Emailer when the tables has been changed(not indivudal values). What is the best method?

Best answer by takashi

Hi @john_eskilstuna, you can read schema features from a dataset with the Schema (Any Format) reader or the FeatureReader.

FeatureReader parameters

A schema feature has an attribute called "fme_feature_type_name" which stores name of the feature type (table), and a list attribute called "attribute{}" which stores attribute names and data types defined.
  • fme_feature_type_name: feature type name
  • attribute{}.name: attribute name
  • attribute{}.fme_data_type: FME generic data type name
  • attribute{}.native_data_type: data type name specific to the data format
See also here to learn about Schema Feature:Dynamic Workflows: Destination Schema is Derived from a Schema FeatureRead schema features from the datasets that you want to compare schemas, explode the "attribute" list with the ListExploder. You can then compare the schema between the datasets.

 

Example:

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.

3 replies

pratap
Contributor
Forum|alt.badge.img+12
  • Contributor
  • 605 replies
  • June 29, 2018

Hi,

Have you tried change detector?

Pratap


takashi
Celebrity
  • 7843 replies
  • Best Answer
  • June 29, 2018

Hi @john_eskilstuna, you can read schema features from a dataset with the Schema (Any Format) reader or the FeatureReader.

FeatureReader parameters

A schema feature has an attribute called "fme_feature_type_name" which stores name of the feature type (table), and a list attribute called "attribute{}" which stores attribute names and data types defined.
  • fme_feature_type_name: feature type name
  • attribute{}.name: attribute name
  • attribute{}.fme_data_type: FME generic data type name
  • attribute{}.native_data_type: data type name specific to the data format
See also here to learn about Schema Feature:Dynamic Workflows: Destination Schema is Derived from a Schema FeatureRead schema features from the datasets that you want to compare schemas, explode the "attribute" list with the ListExploder. You can then compare the schema between the datasets.

 

Example:


john_esk
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • 8 replies
  • July 3, 2018

Hi @john_eskilstuna, you can read schema features from a dataset with the Schema (Any Format) reader or the FeatureReader.

FeatureReader parameters

A schema feature has an attribute called "fme_feature_type_name" which stores name of the feature type (table), and a list attribute called "attribute{}" which stores attribute names and data types defined.
  • fme_feature_type_name: feature type name
  • attribute{}.name: attribute name
  • attribute{}.fme_data_type: FME generic data type name
  • attribute{}.native_data_type: data type name specific to the data format
See also here to learn about Schema Feature:Dynamic Workflows: Destination Schema is Derived from a Schema FeatureRead schema features from the datasets that you want to compare schemas, explode the "attribute" list with the ListExploder. You can then compare the schema between the datasets.

 

Example:

Thank you once again @takashi !