0

I have a Target insert transformation that I'd like to do a delete on the row before insertion (weird niche case that may pop up).

I know the update override allows for :TU.xyz to point at incoming data, but Pre/Post SQL doesn't have the same configure menu.

How would I accomplish this correctly?

jarlh
  • 42,561
  • 8
  • 45
  • 63

2 Answers2

0

From what I recall, Pre- and Post- SQL uses a separate connection so there is no way of referring incoming data.

One thing you could do is flagging/storing the key somewhere and using the flag/instance in the PostSQL query, for example.

Maciejg
  • 3,088
  • 1
  • 17
  • 30
0

Maciejg is correct, there is no dynamic use of Pre and Post SQL.

I would normally recommend an Upsert approach.

But, I found using a MS SQL target, IICS has a bug with doing Insert and Update off a Router. The workaround of using a data driven operation removes batch loading on your insert, so... I now recommend a full data load approach.

From a target with the operation set to Insert, I do batch deletes with Pre SQL. I found this faster and more cost affective than doing delete/insert/update operations individually.

summer fondness
  • 101
  • 1
  • 5