Support Questions

Find answers, ask questions, and share your expertise

Best approach to determine Oracle INSERT or UPDATE using NiFi

Contributor

I have a JSON flow-file and I need determine if I should be doing an INSERT or UPDATE. The trick is to only update the columns that match the JSON attributes. I have an ExecuteSQL working and it returns executesql.row.count, however I've lose the original JSON flow-file which I was planing to use as a routeonattribuite. I'm trying to get the MergeContent to join the ExecuteSQL (dump the Avro output, I only need the executesql.row.count attribute) with the JSON flow. I've set follow before I do the ExecuteSQL:

fragment.count=2

fragment.identifier=${UUID()}

fragment.index=${nextInt()}

Alternativly I could create a MERGE, if there is a way to loop through the list of JSON attributes that match the Oracle table?

3 REPLIES 3

Hi,
Did you get any solution to this ?. I am facing the same issue

Contributor

Yes we managed to get this with work, however the solution did not use NiFi, we used an Oracle View with an INSTEAD of trigger.

Okay Hans !!!

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.