Question

Is there a way to dynamically alter field types?

  • 15 May 2018
  • 1 reply
  • 5 views

Badge +8

The Swedish DOT offers extensive road data as Open Data. It is packaged in an ESRI Personal Database (mdb) with 120+ tables. I want to dynamically load all of the data into Postgis for local storage.

However, quite many fields, scattered in the database structure, are of the type CHAR with a width of 2147483647 (sic!). Of course, no post contains that many characters, and FME tries to convert these fields to VARCHAR with the same width. This breaks the translation with the message that the type VARCHAR cannot exceed 10485760 characters.

So in short, I need a way to filter and catch all tables with fields of the type CHAR, with a width of 2147483647 and alter the width to either the actual content of the field, or a static value that does not truncate what's in there.

Regards, Mats.E


1 reply

Userlevel 4

You can use the FeatureReader which will return a schema feature in addition to all the data features. You can the modify the schema feature to set specific datatypes before sending it along with the data features to the FeatureWriter.

Let us know if you need more specific details.

Reply