0

I am reading in several datasets from a SQL database and writing them to a geodatabase. In some of these datasets there are duplicate attribute names (or what a gdb would consider duplicate due to the case e.g. Geom_AREA and GEOM_AREA).

Is there a way in FME to dynamically identify duplicate names and either delete or append a number to the end of them? Ideally this needs to be able to handle datasets where the duplicate attribute names are unknown before running through the workflow.

asked Feb 6 at 16:05
1

1 Answer 1

1

Yes, by reading and manipulating "Schema" Features. Reading the SQL Server Schema with say a FeatureReader set to "Schema Only" output, will output 1 Feature per Table with all the Field Attributes (such as Field Name) in a List attached to each Feature.

Passing this into a ListExploder will give 1 Feature per Field, for which duplicate Field Names can be found that ignore Case (using say StringCaseChanger + DuplicateFilter) or similarly any particular field name patterns found with a Tester with RegEx test expression patterns.

The manipulated Schema of Original Field Name Revised Field Name vs can then be written into an Eg. External CSV file created with TempPathNameCreator into FeatureWriter, and then this file be used as the input to a SchemaMapper to translate the Data SQL Server Features into the new Schema, and similarly the manipulated Schema Features by rebuilt into revised Schema Features using ListBuilder to build the revised Field Names back into one Attribute List per Table, and these modified Schema Features be used to dynamically set the Writer Schema through Dynamic Writing.

As an aside though, you will get a much better response on the more active FME forums however!

answered Feb 7 at 5:19

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.