Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

DB insert error in PUTSQL

avatar
Explorer

Hi ,

I keep on gettng this error while using PUTSQL processor:

************************

Batch entry 0 INSERT was aborted: ERROR: syntax error at end of input

Position: 7 Call getNextException to see other errors in the batch.. There were a total of 1 FlowFiles that failed, 0 that succeeded, and 0 that were not execute and will be routed to retry; : java.sql.BatchUpdateException: Batch entry 0 INSERT was aborted: ERROR: syntax error at end of input

Position: 7 Call getNextException to see other errors in the batch.

java.sql.BatchUpdateException: Batch entry 0 INSERT was aborted: ERROR: syntax error at end of input

Position: 7 Call getNextException to see other errors in the batch.

*****************************


I used ReplaceText processor prior to this, and the output file content of that processor is :

*******************************

INSERT INTO vzcheckin_visits (visit_data) VALUES ('{

"visits": [

{

"buildingCode": "AZ0014",

"buildingName": "6955 W Morelos Pl, Chandler, AZ 85226, USA",

"entrance": "Front Desk",

"createdDate": "2019-05-08 16:56:40.0",

"cancelled": false

},

{

"buildingCode": "AZ0014",

"buildingName": "6955 W Morelos Pl, Chandler, AZ 85226, USA",

"cancelled": false

}]

}

')

******************************

The above query runs perfect in command line manually except for the ";" taht i have to give at the end.


can you please assist me to solve this error.

@Matt Burgess

1 REPLY 1

avatar
Master Guru

PutSQL actually doesn't want the semicolon at the end (that's for command-line and other stuff that allow multiple statements), do you get the same error if you leave the semicolon off?