Table handling in feature writers

248
3
02-13-2024 07:24 AM
MattHowe
Occasional Contributor

I have a feature writer that writes standalone tables to a file geodatabase reading from a non spatial Oracle database. I'm trying to understand the full functionaility of each table handling option. A description is at
Esri Geodatabase (File Geodb) Writer Feature Type Parameters (safe.com) but I'd like more information. I'm trying to understand which table handling operation I should select. The first time the tool is run the FGDB is empty and so 'Create if Needed' is the probable option. What if I need to run it a second time, would I need to change every reader in my workbench to 'Truncate Existing'? If there are new tables that need adding in future would I need to do the same on the new reader?

  • Create If Needed – Create the destination table if it does not exist. What happens if the table does exist? Will it do nothing or overwrite?
0 Kudos
3 Replies
BruceHarold
Esri Regular Contributor

Hi Matt

There are two properties in play, feature operation and table handling.

If you are always replacing the table data entirely then insert feature operation and drop and create table handling is simple.  This will also create the table if it doesn't exist.

If the table has relationship classes though, dropping the table will also drop the relates (which Data Interoperability cannot recreate), in which case you need to insert features with a truncate existing table handling.

Most elegant is to also read the existing state of the target table, use a ChangeDetector transformer to figure out the delta, then use fme_db_operation feature operation to do insert, update and delete operations as required.  Be aware though that ChangeDetector is brutally strict, things like date precision matter if you include datetimes in the compare.

RenatoSalvaleon3
Esri Contributor

If you use the same file gdb to add new tables, you don't need to add a new reader. When adding new tables to the same FGDB, use the Add Feature type menu item from the Writers menu. It helps keep your workspace clean and easier to manage.

RenatoSalvaleon3_0-1707850396961.png

 

MattHowe
Occasional Contributor

Thanks both, I'll give them a shot.

0 Kudos