title: Getting an exception ORA-00942: table or view does not exist - when inserting into an existing table
body: <p>I am getting below exception, when trying to insert a batch of rows to an existing table</p>
  
  <blockquote>
    <p>ORA-00942: table or view does not exist </p>
  </blockquote>
  
  <p>I can confirm that the table exists in db and I can insert data to that table using oracle 
  sql developer. But when I try to insert rows using preparedstatement in java, its throwing table does not exist error.</p>
  
  <p>Please find the stack trace of error below</p>
  
  <pre><code>java.sql.SQLException: ORA-00942: table or view does not exist
  
      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289) 
      at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573) 
      at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1889)
      at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
      at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
      at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940) 
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout&gt;&gt;(OracleStatement.java:2709)
      at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
      at quotecopy.DbConnection.insertIntoDestinationDb(DbConnection.java:591)
      at quotecopy.QuoteCopier.main(QuoteCopier.java:72) 
  </code></pre>
  
  <p>Can anyone suggest the reasons for this error ?</p>
  
  <p><strong>Update :</strong> Issue solved</p>
  
  <p>There was no problem with my database connection properties or with my table or view name. The solution to the problem was very strange. One of the columns that I was trying insert was of Clob type. As I had a lot of trouble handling clob data in oracle db before, gave a try by replacing the clob setter with a temporary string setter and the same code executed with out any problems and all the rows were correctly inserted!!!.</p>
  
  <blockquote>
    <p>ie. peparedstatement.setClob(columnIndex, clob)</p>
  </blockquote>
  
  <p>was replaced with</p>
  
  <blockquote>
    <p>peparedstatement.setString(columnIndex, "String")</p>
  </blockquote>
  
  <p>Why an error table or view does exist error was throws for error in inserting clob data. Could anyone of you please explain ?</p>
  
  <p>Thanks a lot for your answers and comments.</p>