0

I am unsing Commons DBUtils Oracle 11g Prepared Statement to insert values in my database.

My syntax resembles the following: insert into tablename (col_names) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ? )

I have 10 columns. I am using ? to fill params at runtime.

When I run QueryRunner.insert command I get an exception that it is expecting 11 parameters and I am providing 10. ( the count 11 is coming from some internal class that is setting its count_param to be 11 - I could not figure why)

Is this syntax correct for insert statement?

user1079065
  • 2,085
  • 9
  • 30
  • 53
  • can you execute `java -classpath oracle.jdbc.driver.OracleParameterMetaDataParser ""` and show the result? – wero Apr 22 '16 at 21:28
  • If you're using Oracle 11g why have you included a MySQL tag? Please don't be confusing. – APC Apr 23 '16 at 04:48

1 Answers1

0

That syntax is correct for an INSERT statement in MySQL.

I'd recommend using this as a reference in the future http://dev.mysql.com/doc/refman/5.7/en/

Evan Hall
  • 58
  • 1
  • 8
  • Also, SQL GUI tools like MySQLWorkbench () are worth looking into, as they allow you to test your queries outside of your code. – Evan Hall Apr 22 '16 at 21:31