title: ORA-01002: fetch out of sequence
body: <p>I am getting org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL </p>
  
  <pre><code>UPDATE responses 
  SET    version_no = ( version_no + 1 ), 
         read_status = 0, 
         tslastmodified = SYSDATE 
  WHERE  responseid IN (SELECT responseid 
                        FROM   responses 
                        WHERE  read_status = 1 
                               AND tslastmodified &lt; SYSDATE - 45 / ( 24 * 60 ) 
                               AND id IN (SELECT id 
                                          FROM   emp)) 
  </code></pre>
  
  <p>; SQL state [24000]; error code [1002]; ORA-01002: fetch out of sequence
  ; nested exception is java.sql.SQLException: ORA-01002: fetch out of sequence</p>
  
  <p>JAVA code :</p>
  
  <pre><code>getJdbcTemplate().queryForObject(SurveyQuery.UPDATE_INPROCESS, Integer.class);
  </code></pre>
  
  <p>Please let me know what is wrong in above query</p>