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

Why PutSQL not working?

Why PutSQL not working?

Explorer

79387-to-values.jpg

Trying to insert data in postgresql database.
In pgAdmin this statement is working.
What's wrong?

79386-putsql-details2.jpg

79385-putsql-details.jpg

3 REPLIES 3

Re: Why PutSQL not working?

Explorer

Hi

May i know what error you are facing. If you can attach error snippet, it will be of great help in locating issue.

Re: Why PutSQL not working?

Super Guru

I set up a similar test (with only the first two JSON fields and different table/column names) and it works just fine in NiFi. If yours is working in pgAdmin with hard-coded values then I'm guessing there is something with the NiFi Expressions. Assuming those are flow file attributes, do any of them have values that might contain a double-quote? In any case you may want to call escapeJson() on them before they are evaluated into the JSON object, such as:

"ticker": "${ticker:escapeJson()}"

Re: Why PutSQL not working?

New Contributor

Just in case somebody's looking at this, setting "Support Fragmented Transactions" to false solves the issue