Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Best approach to determine Oracle INSERT or UPDATE using NiFi

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
Highlighted

Re: Best approach to determine Oracle INSERT or UPDATE using NiFi

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

Highlighted

Re: Best approach to determine Oracle INSERT or UPDATE using NiFi

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.

Highlighted

Re: Best approach to determine Oracle INSERT or UPDATE using NiFi

Okay Hans !!!

Don't have an account?
Coming from Hortonworks? Activate your account here