Home  >  Forum  >  Database
Post New Query

java.sql.SQLSyntaxErrorException: ORA-00936: missing expression


joined on
September 16,2014
Asked on March 03,2015
Hi friends, I am new to JDBC. I am trying to insert rows in oracle database using PreparedStatement through JDBC. code snippet is

PreparedStatement preStat = connection.prepareStatement("insert into user_form values (?,?,?,?,?,?,?,?,?,)");

And getting error as below.

java.sql.SQLSyntaxErrorException: ORA-00936: missing expression

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1017)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:655)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:249)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:566)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
java:215)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.
java:58)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedSta
tement.java:943)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStateme
nt.java:1075)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePrep
aredStatement.java:3820)
        at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStat
ement.java:3923)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePrepa
redStatementWrapper.java:1385)
joined on
March 15,2013
Replied on March 04,2015

Look at your SQL query you have left a comma(,) delete it and check it again.
Your query is: PreparedStatement preStat = connection.prepareStatement("insert into user_form values (?,?,?,?,?,?,?,?,?,)");

Correct query is : PreparedStatement preStat = connection.prepareStatement("insert into user_form values (?,?,?,?,?,?,?,?,?)");

Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us