Skip to main content
Question

truncate table and append

  • January 18, 2022
  • 8 replies
  • 1056 views

fme_can_do_it
Enthusiast
Forum|alt.badge.img+9

I need to truncate the existing table and append data. I have two tables one from versioned sde and the second table is in FGDB. I need to delete rows from the table in sde and append data from FGDB. I have to do field mapping after appending data from FGDB. I am not sure what would be the workaround to accomplish this task. Please suggest any workaround.

8 replies

takashi
Influencer
  • January 18, 2022

Hi @fme_can_do_it​ , have you tried setting Truncate Existing to the Table Handling parameter in the writer feature type? 


fme_can_do_it
Enthusiast
Forum|alt.badge.img+9
  • Author
  • Enthusiast
  • January 18, 2022
takashi wrote:

Hi @fme_can_do_it​ , have you tried setting Truncate Existing to the Table Handling parameter in the writer feature type? 

Hi @Takashi Iijima. I need to truncate the table before writing to my destination table. Also, after truncating rows, I need to append data in the table from file gdb and perform field mapping, then I will write the final data.


takashi
Influencer
  • January 18, 2022
fme_can_do_it wrote:

Hi @Takashi Iijima. I need to truncate the table before writing to my destination table. Also, after truncating rows, I need to append data in the table from file gdb and perform field mapping, then I will write the final data.

The writer feature type with "Truncate Existing" mode will firstly truncate (delete all records from) existing table and then insert all the new records into the table. Isn't it your desired behavior?


fme_can_do_it
Enthusiast
Forum|alt.badge.img+9
  • Author
  • Enthusiast
  • January 18, 2022
fme_can_do_it wrote:

Hi @Takashi Iijima. I need to truncate the table before writing to my destination table. Also, after truncating rows, I need to append data in the table from file gdb and perform field mapping, then I will write the final data.

Yes, but it's slightly different. I want to map fields as well before writing this to my final destination table. Is there any way we can set up a call so I can explain better what I am actually needing to accomplish? that would be a great help if it's possible.


takashi
Influencer
  • January 18, 2022
fme_can_do_it wrote:

Hi @Takashi Iijima. I need to truncate the table before writing to my destination table. Also, after truncating rows, I need to append data in the table from file gdb and perform field mapping, then I will write the final data.

Do you need to configure new fields in the destination table automatically mirroring the source dataset schema?


fme_can_do_it
Enthusiast
Forum|alt.badge.img+9
  • Author
  • Enthusiast
  • January 18, 2022
fme_can_do_it wrote:

Hi @Takashi Iijima. I need to truncate the table before writing to my destination table. Also, after truncating rows, I need to append data in the table from file gdb and perform field mapping, then I will write the final data.

So the schema is not the same, so if I truncate and append data,I am going to have some fields blank due to different field names and I will have to populate those fields that remained blank after append data.


takashi
Influencer
  • January 18, 2022

Set "Drop and Create" to the Table Handling parameter rather than "Truncate Existing", if you need to change the destination table schema.

And if you need to configure the destination schema dynamically, see this article to learn dynamic workflow.

 


Forum|alt.badge.img+2
  • January 18, 2022

@fme_can_do_it​ I think you can use the AttributeManager to do the field mapping between the File GDB and the ArcSDE GDB. Then you can use the Truncate Existing in the Table Handling parameter in the Writer Feature Type, as suggested by @Takashi Iijima​ . If you have many feature classes and attributes you can try the SchemaMapper for the field mapping.

Most of these steps are covered in our free, online FME Academy training modules if you are new to FME.


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