Solved

Unable to write to GDB when setting date as data type

  • 14 October 2016
  • 5 replies
  • 41 views

Badge +4

My workspace keeps issuing warnings and dropping containing features when I set the data type for an attribute to 'date', and it creates my GDB table but doesn't write any features to it. When I set the data type to text on the writer, it writes it out just fine.

The date is formatted like this: MM/DD/YYYY. Should that matter?

icon

Best answer by takashi 15 October 2016, 04:19

View original

5 replies

Userlevel 3
Badge +17

Hi @dmatranga, probably so. Try formatting the date string in "YYYYMMDD" - FME standard date format: %Y%m%d.

Badge +16

yes esri is quite rigurous about its data types, the fme standard date format works just fine.

Badge +4

Thanks for the feedback @takashi, I'm finding out that FME Desktop seems to have a hard time creating and writing geodatabase feature classes with data types specified if they aren't strings.

Will try this alternate format for the dates and see if that works.

Badge +4

So I tried using a DateFormatter to reformat to YYYYMMDD, and in FME 2016, it drops the containing features.

In FME 2017 (Beta, 17169), when I set the attribute on the writers (outputting an Excel spreadsheet and a GDB), the attribute turns pink and I'm not able to connect the attributes at all.

I'm sure this will be addressed if it's a bug, was just trying to make sure I wasn't missing something.

As far as I understand, FME handles all attribute values as strings until you want to actually write to your output data, when does FME allow you to actually change the data type to what you would like it to be in your destination dataset, other than on the actual writer itself? Is there any other way to change a data type before it gets to the writer, to prevent issues writing to your output dataset?

Userlevel 3
Badge +17

So I tried using a DateFormatter to reformat to YYYYMMDD, and in FME 2016, it drops the containing features.

In FME 2017 (Beta, 17169), when I set the attribute on the writers (outputting an Excel spreadsheet and a GDB), the attribute turns pink and I'm not able to connect the attributes at all.

I'm sure this will be addressed if it's a bug, was just trying to make sure I wasn't missing something.

As far as I understand, FME handles all attribute values as strings until you want to actually write to your output data, when does FME allow you to actually change the data type to what you would like it to be in your destination dataset, other than on the actual writer itself? Is there any other way to change a data type before it gets to the writer, to prevent issues writing to your output dataset?

I believe that the DateFormatter works to change date format from %m/%d/%Y to %Y%m%d, if you have set the Source / Destination Date Format parameter properly.

 

FME determines internal data types for each feature attribute depending on the context, and finally the writer will automatically cast the attribute value to the native data type of the destination format according to the schema configuration for the destination feature type. Usually you don't need to care the internal data types, but regarding a date string, you will have to format it properly so that the writer can recognize the date value correctly.

 

Reply