Support Questions
Find answers, ask questions, and share your expertise

Nifi putsql processor error: Due to org.postgresql.util.PSQLException: The column index is out of range: 1

I try convert ingect json file into postgresql for that first i try to convert my json file into sql format by using ConvertJSONToSQL processor, after that I pass flow into replacetext processor and after that I make flow into putsql processor. In putsql processor I got issue "Due to org.postgresql.util.PSQLException: The column index is out of range: 1"



PutSQL Error:


PutSQL processor configuration


ReplaceText processor configuration


Replacement Value: "INSERT INTO public.detail (id,name, salary) VALUES (${id},${name},${salary})"

ConvertJSONToSQL processor configuration



We are getting same error, please post if you found any solution for this error.

Super Collaborator

Hi @Narasimma varman,

Apparently this is the error form Postgres Driver, when I dig the reference for the error, got to know that when the mismatch of the column list or any issues with the sql is the possible root cause for the error.

however, when I look the sql I couldn't see the value for the Name is not quoted.( being the char column in SQL must be quoted).

any other column which is of char/date must be quoted in sql.

INSERT INTO public.detail (id,name, salary) VALUES (${id},'${name}',${salary})

On the other note, you could use convert json sql to --> put sql direct,

perhaps you may use json to Attribute --> Replace Text and then to --> putSQL. for the same thing if you wish to do it in different way.

Hope this helps !!

Super Collaborator

and please ensure that, there are no columns in salary ( if it is defined as Decimal/integer in Database)