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.

Apache Nifi Bind Variable- Oracle

Solved Go to solution

Apache Nifi Bind Variable- Oracle

New Contributor

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

Accepted Solutions

Re: Nifi Set Bind Variable

New Contributor

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)

3 REPLIES 3

Re: Apache Nifi Bind Variable- Oracle

New Contributor

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)

Nifi Set Bind Variable

New Contributor

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'

 

Re: Nifi Set Bind Variable

New Contributor

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)

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