Skip to main content
Solved

set writer attributes width and type

  • June 27, 2018
  • 11 replies
  • 137 views

boubcher
Contributor
Forum|alt.badge.img+11

Hello There

During a cleaning process, our work space failld process due to the reader attributes with value are 0.

we need to add a process to set the width and type of the atribute in order to avoide such issue

Best answer by tigerwoulds

There's a custom transformer called SchemaSetter that will allow you change the string length in your writer.

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.

11 replies

danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • June 27, 2018

Hi @boubcher

For the Width, you can use the transformer StringLenghCalculator by Attribute. This transformer create a new attribute to hold the results.

Thanks,

Danilo


danilo_fme
Celebrity
Forum|alt.badge.img+51
  • Celebrity
  • 2077 replies
  • June 27, 2018

Hi @boubcher

For the Width, you can use the transformer StringLenghCalculator by Attribute. This transformer create a new attribute to hold the results.

Thanks,

Danilo

The transformer AttributeValidator, you can use to validate the type of attribute.

 

 

 

 


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • 212 replies
  • June 27, 2018

Hi @boubcher

For the Width, you can use the transformer StringLenghCalculator by Attribute. This transformer create a new attribute to hold the results.

Thanks,

Danilo

Thanks , but the stringlenghcalculator will give me the length of the value it's self the problem is when wene we read the attribute it has the max length and it not set to the right one from the reader and wehn you write to dB we don't have possibility to change specifically when you use dynamic mode

 

 


takashi
Celebrity
  • 7843 replies
  • June 28, 2018

Hi @boubcher, if your requirement is to change the destination schema definition (attribute names and/or data types) for a dynamic writer feature type, you will have to derive the schema from an external dataset which has desired schema definition or a lookup table which you defined desired schema. See these links to learn more.


takashi
Celebrity
  • 7843 replies
  • June 29, 2018

I cannot see any problem in the screenshot you have posted (I reposted below), and cannot understand correctly what is going on from your question. We need more specific and correct explanation on the conditions and the requirements.

(reposted)


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • 212 replies
  • June 30, 2018

I cannot see any problem in the screenshot you have posted (I reposted below), and cannot understand correctly what is going on from your question. We need more specific and correct explanation on the conditions and the requirements.

(reposted)

@takashi

 

 

Thanks so much for your replay

 

we did solve the problem by open GeoDb in ARC and do all the adjustments there for now'

 

but we will see if this issue will be available for the next data provider

 

I have to get all this QC through FME

 

anyway thanks, we will advise

 

 


nathanatsafe
Safer
Forum|alt.badge.img+9
  • Safer
  • 284 replies
  • September 17, 2018

@boubcher, I have just uploaded a custom transformer to the FME Hub which may solve your problem. It dynamically sets writer string attribute widths based on actual analysis of input attribute values. At the very least maybe the python code can be co-opted for your purposes.

 

Best,

 

Nathan

  • 4 replies
  • Best Answer
  • February 27, 2020

There's a custom transformer called SchemaSetter that will allow you change the string length in your writer.


  • 3 replies
  • May 6, 2020

Hi @boubcher, if your requirement is to change the destination schema definition (attribute names and/or data types) for a dynamic writer feature type, you will have to derive the schema from an external dataset which has desired schema definition or a lookup table which you defined desired schema. See these links to learn more.

Like most things in FME. The most mundane data transformations that could generally be accomplished by a few lines of SQL or R are ridiculously laborious and difficult. Unfortunately my organisation has chosen to use this software so I have to spend most of my days wading through a bewildering variety of transformers along with their associated documentation which give you little idea regarding what they are actually designed to do. I usually have to try a few out before I get anywhere near accomplishing anything like the desired result, returning again and again to this forum. This thing is like shooting cannonballs at sparrows. It sucks.


  • 3 replies
  • May 6, 2020

Hi @boubcher

For the Width, you can use the transformer StringLenghCalculator by Attribute. This transformer create a new attribute to hold the results.

Thanks,

Danilo

That appears to work for one attribute. What if you have to change the width of them all?


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • 212 replies
  • May 15, 2020

Thanks Guys