Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Execute Oracle stored procedure returning a cursor without ExecuteScript processor

avatar
Frequent Visitor

Hi guys:

It's possible to run Oracle stored proc that return a cursor as SP parameter using only NiFi processors?

4 REPLIES 4

avatar
Master Collaborator

Running Stored procedures from NiFi sql based processors  is not possible however you can use following suggestion suggested at https://community.cloudera.com/t5/Support-Questions/Execute-Stored-Procedure-of-MSSQL-in-Nifi/m-p/21...

 

Thank You.

avatar
Frequent Visitor

Using ExecuteSQL you can run stored procedures I have used before. The matter is when the stored procedure use output parameters to return results. Is there any processor to convert those ref parameters to flowfiles? My environment involve an Oracle database with stored procedures returning data as output cursors.

avatar
Super Guru

Hi,

In the ExecuteSQL or ExecuteSQLRecord you have Pre Query, Select Query and Post Query properties. In the Pre Query can you declare variables to store the output parameters, run the stored proc passing those parameter and then insert them into a temp table which then you can use the Select Query property to read the values from the temp table and that will translate to flowfiles. If you are using the ExecuteSQLRecord you can define in which format you want the flowfile in by defining the record writer property. Hope that helps.

avatar
Frequent Visitor

Hi @SAMSAL:

I was trying to implement your solution but I didn't find a way to define a SYS_REFCURSOR in Pre-Query statements. Can you share any working simple example using Oracle DBMS?