I try convert inject 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
NIFI Flow:

PutSQL Error:

Replacement Value:
INSERT INTO public.detail (id,name, salary) VALUES (${id},${name},${salary})
Before the putSQL,you may have flowfile content like below.,
id-->1
name->stack
salary->12k
INSERT INTO public.detail (id,name, salary) VALUES (1,stack,12k)
if any value missing you would face issue that index of the value :1 is not found.
For example if 'id' attribute not exists in incoming flowfile you may receive that error.
So you have to check all attributes in incoming flow file has exists and correctly formed insert query. [Or] Take that insert query formed after queuing in putSQL incoming queue and execute that in PostgresSQL.
If it executes there then it execute putSQL also.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With