Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Apache Nifi Bind Variable- Oracle

avatar
Explorer

Hi,

I have a Nifi workflow that puts data from MS SQL to Oracle.  I have some queries that I used " binding" such as 

 

...

where MUST.MID = ${MID} and not exists (select a_id from tbl_a where a_id = ${MID}).

 

But the variables behaves like "literal" variables on Oracle. (it runs everytime such as  where MUST.MID = 50 and not exists (select a_id from tbl_a where a_id = 50))

 

What can I do for binding in Oracle part?

 

Thank you in advance. 

1 ACCEPTED SOLUTION

avatar
Explorer

I found the solution: Create the procedure which takes parameter in Oracle side and use Execute SQL to run the procedure( give the flowfile attribute as the parameter of the procedure)

View solution in original post

3 REPLIES 3

avatar
Explorer

I mean is there any way to set a parameter with a flowfile attribute and also send the query as it is binded(such as MID = :B😛)

avatar
Explorer

How Can I use the attributes of flowfile as a setter parameter to Oracle bind variable?

 

Example 

 

variable Bdetail varchar(1000)
variable BMID NUMBER
variable BCont Varchar(1000)


:Bdetail := ${DETAILS}
:BMID := ${MID}
:BCont := '${CONTACT_TYPE}'


UPDATE TBLM SET Phone = :Bdetail

    WHERE MUSTERI_ID = :BMID
           AND :BCont = 'MOBILE'

 

avatar
Explorer

I found the solution: Create the procedure which takes parameter in Oracle side and use Execute SQL to run the procedure( give the flowfile attribute as the parameter of the procedure)