theangryangel / logstash-output-jdbc

JDBC output for Logstash
MIT License
255 stars 101 forks source link

Error with inserting too many parameters #139

Closed thekofimensah closed 6 years ago

thekofimensah commented 6 years ago

I'm using logstash 6.1.2 and I'm getting the following error: Any advice on how I can insert more than 45 values into my sql table? I'm inserting about 58 colunms

{:exception=>java.sql.SQLException: Parameter index out of range (46 > number of parameters, which is 45).}

statement => [ "INSERT INTO production VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ,?, ?, ?, ?, ?, ?, ?, ? ,?, ?, ?, ?, ?,?, ?, ?, ?, ?, ?, ? ,?, ?, ?, ?, ?, ?, ?)", "[id],[location], .......

theangryangel commented 6 years ago

Usually you get that there when you have a mismatched number of placeholders (?) and parameters (it's telling you that you have tried to set 46, but have 45 parameters). Double check you've not made a mistake.

thekofimensah commented 6 years ago

Ok, I checked and you were right! Thanks!! :D