Skip to main content
Question

NullAttributeMapper not mapping to a true null?

  • December 9, 2021
  • 5 replies
  • 115 views

joe.fme
Contributor
Forum|alt.badge.img+6

Hi all, I'm trying to map fields to match a SQL table where some need to be Null and others are Not Null. As far as I can see, I've done this correctly in the 2 NullAttributeMapper Transformers (attached screenshots).

Basically I need some to be Null, and others to be Not Null. These have been separated in the screenshots below by 2 NullAttributeMappers.

 

I've attached the error as well, as this is proving to be quite tricky. Any help is appreciated.

5 replies

redgeographics
Celebrity
Forum|alt.badge.img+59
  • Celebrity
  • 3700 replies
  • December 9, 2021

Could it be that you've forgotten to add the error message?

 

Also, I think it could be helpful if you could post a screenshot of the data in Visual Preview's Table View from immediately after the NullAttributeMapper(s)


joe.fme
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 40 replies
  • December 9, 2021

Hi red,

 

I've since attached them (been one of those days..weeks..possibly longer). You can see the difference between a Null value and a blank one, which is what the issue is - as it should be blank/empty, and not a Null


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • December 9, 2021

I'm not sure you can write an empty string into a smallint column? So I think that is your problem. FME is trying to be clever and convert the empty string to null but you can't insert a null as that is not allowed for that field either.


joe.fme
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • 40 replies
  • December 9, 2021

I'm not sure you can write an empty string into a smallint column? So I think that is your problem. FME is trying to be clever and convert the empty string to null but you can't insert a null as that is not allowed for that field either.

You may be onto something here. In the case I can't write an empty string there is there any way to get around it? I'll speak with our DBA team but I didn't know if a space or otherwise would suffice?


ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • December 9, 2021

You may be onto something here. In the case I can't write an empty string there is there any way to get around it? I'll speak with our DBA team but I didn't know if a space or otherwise would suffice?

I suspect you will have to agree some sort of dummy integer value if nulls are not allowed