Skip to main content
Question

NullAttributeMapper not mapping to a true null?


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

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

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+4
  • Author
  • Contributor
  • 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+39
  • Influencer
  • 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+4
  • Author
  • Contributor
  • December 9, 2021
ebygomm wrote:

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+39
  • Influencer
  • December 9, 2021
joe.fme wrote:

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


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