Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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: enter image description here

PutSQL Error: enter image description here

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

like image 802
R. Narasimma varman Avatar asked Nov 24 '25 07:11

R. Narasimma varman


1 Answers

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.

like image 119
Mister X Avatar answered Nov 26 '25 22:11

Mister X



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!