I'm getting ORA-00933 when creating the following prepared statement for Oracle 10g (10.2.0.1.0) using JDBC:
conn.prepareStatement("INSERT INTO fx_tv_date (id, mp, doc_id, effective, actual, stale, val) VALUES (?, ?, ?, ?, ?, ?, ?)");
That line is throwing the following exception...
java.sql.SQLException: ORA-00933: SQL command not properly ended
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207)
oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:801)
oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:841)
oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1274)
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:205)
This works fine in MySQL & MS SQL Server so I guess it's a syntax difference with Oracle, but having searched online I can't seem to see the cause. For clarity here's the prepared statement on its own:
INSERT INTO fx_tv_date (id, mp, doc_id, effective, actual, stale, val) VALUES (?, ?, ?, ?, ?, ?, ?)
Thanks!
prepareStatementappears nowhere in the stack trace that you've shown. I wouldn't expectprepareStatementto result in a call toexecuteQuery.