Support Questions

Find answers, ask questions, and share your expertise

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