0
votes

I need to generate SQL insert statement using JSON data (key-value pairs) and execute the INSERT SQL statement to write to DB2. I am using processors ConvertJSONtoSQL and PutSQL in NiFi. My PutSQL is throwing error.

PutSQL Configuration:

enter image description here

I am getting output flow file like this.

INSERT INTO TEST_TABLE (COL1, COL2, COL3) VALUES (?, ?, ?)

Are the question marks expected? I am getting error in the PutSQL processor.

enter image description here

1
what does your json look like and what is the table schema? - Sdairs
I figured this. It was due to date mismatch fields. I had to do a date conversion using Update Processor. Thanks for your reply. Appreciate it. @Sdairs - ang_coder

1 Answers

1
votes

The question marks are expected as this is the way JSON to SQL processor works. I think this is data error where data type is not matching with SQL table column data types. Please revalidate your data.