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 Postgres Procedure in Nifi

avatar
Explorer

I have requirement to execute a PostgreSQL procedure in Nifi,

 I tried to use Put Sql processor , but ended up getting error.

 

Could someone let me know what I'm doing wrong.

 

ralvad_0-1669964565449.png

ralvad_1-1669964662286.png

This is how my entire flow looks like. 

-querying from a table and putting the record to another stage table using the first 'PutSql' processor. And afterwards the second putsql processor to call my stored procedure. 

 

ralvad_2-1669964825058.png

 

2 REPLIES 2

avatar

This looks like a pSQL error to me, not NiFi specific.

Maybe you try to insert into a table that doesn't exist (typo?) or the number of columns doesn't match

I think this will help you

https://stackoverflow.com/questions/36439305/error-the-column-index-is-out-of-range-1-number-of-colu...

avatar
Explorer

Thanks @dominikschauer . I tried ExecuteSQL processor to run the Postgres procedure and it ran succesfully.

 

ralvad_0-1669992941766.png

But I am getting the error while connecting  PutSQL processor to ExecuteSQL processor.

As part of my requirement , I need to execute the procedure(ExecuteSQL) after inserting data into a particular table using PutSQL processor. Is there any other way I can achieve this, that is run a procedure after successful insertion to a table.

 

Thanks in advance