Skip to main content
Solved

set writer attributes width and type


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.

View original
Did this help you find an answer to your question?

11 replies

danilo_fme
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • 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
Evangelist
Forum|alt.badge.img+45
  • Evangelist
  • June 27, 2018
danilo_fme wrote:

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
  • June 27, 2018
danilo_fme wrote:

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
Influencer
  • 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
Influencer
  • 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
  • June 30, 2018
takashi wrote:

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+7

@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

  • Best Answer
  • February 27, 2020

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


takashi wrote:

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.


danilo_fme wrote:

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
  • May 15, 2020

Thanks Guys

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings