Â
Â
Does FME Desktop 2013 write empty string & NULL values as NULL ?Â
If no. how can I do that? I wish to write both NULL and empty strings as NULL.Â
ThanksÂ
Â
Does FME Desktop 2013 write empty string & NULL values as NULL ?Â
If no. how can I do that? I wish to write both NULL and empty strings as NULL.Â
ThanksÂ
Â
In FME 2013, you should use the AttributeRemover to make null value.Â
According to this documentation, FME 2014 will support null value. How does FME handle null attribute values?Â
http://fmepedia.safe.com/articles/FAQ/How-does-FME-handle-Null-attribute-values#heading_toc_j_3Â
TakashiÂ
So test your attribute for null and empty, tester/testfilter has a switch for that in the Operater (click and roll it out)Â
Â
Â
Alsowhen u have more then 1 stream entering a writer and one has a certain attribute and the other hasnt, the one without will yield null values for those missing attributes.Â
Â
I understand that writing "" does not yield null to certain filetypes (?)Â
When the field is a numeric type, writing a string (including "") makes null. Maybe the writer log a warning.Â
But when the field is a character string type, sending "" will write an empty string into the field. It's not null.Â
If you have to write null into a field, you have to remove the attribute (FME 2013).Â
Â
Talking about Tcl...Â
The AttributeRemover is generally used, but the TclCaller can be also used to remove attributes. For example, the TclCaller with this script removes "attr1" and "attr2" if it's empty.Â
-----Â
proc setNull {} {Â
 foreach name {attr1 attr2} {Â
  if {pFME_AttributeExists $name]  \\Â
    && string compare pFME_GetAttribute $name] ""] == 0} {Â
    FME_UnsetAttributes $nameÂ
  }Â
 }Â
}Â
-----Â
Â
Naturally, the PythonCaller can be also usedFor 2013 when we read a null value then it won't be an empty value, the attribute will be missing entirely. That's why the Tester lets you test for Missing. Actually if you set it to test for Null, it will just test for missing too.
Â
Â
Again in 2013 you can't set a null value in an attribute. But if the attribute is missing when it is written then that would probably force a null in a database. For non-databases it would be format dependent (eg in MapInfo I think we write -9999, which is the MapInfo equivalent to Null).Â
Â
In 2014 we support nulls properly. The beta build is online if you want to try it. We'll read a value as null and the Tester will now test for null values (and give a different result to testing for Missing). Many other transformers have been updated to use and account for null values.Â
Â
Similarly we'll now write nulls directly to a dataset/database.Â
Â
The new NullValueMapper is the transformer that you can use to set features as null or not.Â
Â
You can find more info on fmepedia (http://fmepedia.safe.com/articles/FAQ/How-does-FME-handle-Null-attribute-values) and I'll be writing an FME Evangelist blog post shortly to explain all the 2014 updates.Â
Â
Hope this helps. I'm really looking forward to 2014 being out there and our customers getting to use the null functionality,Â
Â
RegardsÂ
Â
MarkÂ
Â
Mark IrelandÂ
Product EvangelistÂ
Safe Software Inc.