Created 02-10-2022 04:47 AM
Hi,
can someone help me to find solution for execute plsql oracle procedure after I finish putin record in my table in database. I have flow like this
and when all job is done I have to execute procedure with max and min ID from this flow...
Thanks in advance
Created 02-10-2022 06:17 AM
Created 02-11-2022 12:17 AM
Hi,
I am new in nifi so I don't know how to create and pass parameter with max and min value of my ID in source table to plsql procedure... Please help. My whole flow now looks like this
I add another processor like this with two parameters
and I pass those parametres to proseccor like this
then I get error
Thank you
Created 02-11-2022 06:01 AM
I would recommend do a test of the procedure without parameters by inserting test values directly to ensure it works. This will do 2 things, first; confirm the procedure works, and second; indicate the issue with min/max is in the QueryRecord. While testing flow, you should be able to see what the values of min/max are by inspecting the flowfile/attributes.
Created 02-11-2022 06:03 AM
Hi,
I have already tried and everything works when there are no parameters
Created 02-11-2022 06:09 AM
Ok great, then the issue is the QueryRecord. In your flow I can see that min and max are both routes to PutSQ, not attributes of a single flowfile.
Have you inspected these flowfiles to see if they contain the correct values you need?
Does it send 2 flowfiles to PutSQL?
${min} and ${max} is an attribute syntax. I believe you will need to get the min and max into a single flowfile and extracted as attributes to send to PutSQL
Created 02-11-2022 06:27 AM
Hi,
I made some changes....
Now, I have two separate flow files (one for insert and one for delete) which works fine. And in the end I put Output port.
After that job is done, I need to execute plsql procedure from destination database, so I made another process group with input port and another flow
Processor generate table fetch selecting max and min date from one table like this
And after that I need those two values to pass to plsql procedure and I don't know how.
Query record processor look like this
Last processor putsql look like this
But this also doesn’t work
because in last que i get two separate flow files one with min value and one with max....I think that is problem.... and I need one with two values that i can pass to plsql procedure
Created 02-11-2022 07:54 AM
Excellent progress. Can you try doing a single select to get both values?
Like this: SELECT MAX(ID),MIN(ID) FROM FLOWFILE
If you could do that, then you could extract those values into 2 separate attributes, then feed that flowfile to the next processor in the flow. Another alternative is to extractText for each value to an attribute, then MERGE 2 flowfiles into 1.
Created 02-11-2022 08:03 AM
Hi,
yes I can do this
And then I get
and when I call procedure it doesn't work
Do I need more steps between query record and executing procedure?
Created 02-11-2022 08:09 AM
Hi,
As you can see I tried with Id instead date just to be sure that problem is not because format date, but it is not the problem. Problem is how to send those values to procedure.....