Question

What is the fme_where syntax for specifying multiple fields to update by? Single DB2 Writer doesn't seem to handle INSERTS and UPDATES

  • 27 April 2021
  • 0 replies
  • 5 views

Badge +2

What is the fme_where syntax for specifying multiple fields to update by?

I've tried this syntax, but it doesn't seem to work in my scenario.

 

New Attribute: fme_where

Attribute Value: YEAR = @Value(YEAR) AND MONTH = @Value(MONTH) AND PLANT = @Value(PLANT) AND UNIT = @Value(UNIT)

 

I'm using a DB2 writer and I have to handle inserts and updates coming through. It seems that the single DB2 writer can only handle INSERTS or UPDATES, not both. When I enter values in the "Update Key Columns" property on the DB2 Writer, all incoming rows are treated as Updates even though the fme_db_operation value says INSERT. And vice versa. When I remove the value in the "Update Key Columns", all rows are treated as Inserts, even when the fme_db_operation values says UPDATE.

 

I thought I could delete the values from the "Update Key Columns" property on the DB2 writer, and then create the fme_where attribute and specify the key columns to use for the UPDATE. But it didn't work. I had one UPDATE and one INSERT come through and both were treated as inserts, so I got an extra row in my DB2 table.

 

Is the fme_where syntax incorrect? Does it NOT handle multiple key columns? Is there another option such as use multiple DB2 writers for the same DB2 table, one with the "Update Key Column" value and one without to handle inserts?

 

Thank you.

Sarah

FME(R) 2019.1.2.0 (20190829 - Build 19630 - WIN64)

fme_where


0 replies

Be the first to reply!

Reply