Skip to main content
Hello!

 

 

Im someway aware of the problem FME has with handling the NULL-values (http://evangelism.safe.com/fmeevangelist89/).

 

My question is: how is it possible to write NULL values when dealing with ESRI geodatabases?  

 

I have noticed that FME 2013 has an option in AttributeValueMapper transformer to set destination value to Null. Still, it does'nt  seem to work. Running the workspace gives me warnings like:

 

FileGDB Writer: The `kood' attribute could not be written. The containing feature has been dropped.

 

 

The field 'kood' is smallint type and declared to allow NULL values. 

 

 

So the general question is: is it at all possible to set attribute values to NULL inside FME and subsequently write NULL values to geodatabase?

 

 

 

Thank you,

 

Raivo 

 

Estonian Land Board

 

 

 

Unfortunately, properly handling NULL values is something that FME still struggles with, from a strict database point of view. The easiest way is to delete the attributes where you want to write NULL values, but it can be a bit cumbersome, in my opinion.

 

 

I think your easiest solution would be to download the custom transformer "NullAttributeRemover" from the FME Store. It allows you to specify a list of attributes to check for, and it automatically removes the attributes when they contain either 0 or an empty string. It is also quite simple to modify this to suit your particular needs, if necessary.

 

 

Good luck!

 

 

David

Thanks David!

However, this does not work in case of UPDATE. I can have my NULLs only when inserting features, but my scenario needs to update features aswell, sorry, I forgot to mention that :(

 

 

 

Raivo 
Hi Raivo,

 

We are currently working on a project to provide much improved NULL support in FME 2014 so I added your name to one of the problem reports which will be solved by this project. You will be notified when support becomes available in a beta release.

 

 

Cheers,

 

Robyn Rennie

 

FME Desktop Support
If your ouput format supports it, I would consider using an SQLExecutor to update the NULL values. This of course assumes that the geometry doesn't change as well, so unfortunately no perfect solution...

 

 

@Robyn: Good to hear that you're working on improving this!

 

 

David
Thanks Robyn and David!

 

Using SQLExecutor could be a solution, but its tricky in a way that edits on a versioned geodatabase are managed via delta tables. So SQL UPDATE needs to consider that. I'll take some time to try that atleast.

 

 

Raivo

 

 


I had success using GEODATABASE_SDE writer advanced properties "SQL Statement to Execute After  Translation". 

Multiversioned views is the key (http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/in_PostgreSQL/006z0000001q000000/). So after creating multiversioned view and version for edits, I submitted following lines to FME after sql statement:

SELECT sde.sde_set_current_version('mvedits'); SELECT sde.sde_edit_version('mvedits',1); update hudrograafia_p_2 set atr=null where atr=666;

 

SELECT sde.sde_edit_version('mvedits',2); 
Robyn: Please also add me in this loop. As working with NULL-values seems a bit off/on 😕. Trying to read a dataset now (have tried both from Excel and from MSSQL) and those features that has the value ID = NULL does not get the value ID. So when I later test for ID = '' it will not return anything. I need to be able to add to the READER (or WRITER) how to handle NULLS. IE, should it read/create NULLs of attributes that are missing.
Using the AttributeValueMapper you can set NULL as the default value, this is new in FME2013 (might be the SP1 Beta):

 

 

 


Reply