title: Why do I get error ORA-08002 when trying to get the currval of a sequence?
body: <p>In TOAD I can execute this query:</p>
  
  <pre><code>select my_seq.currval from dual;
  </code></pre>
  
  <p>But when I try to execute it in my application I get this error:</p>
  
  <pre><code>java.sql.SQLException: ORA-08002: sequence MY_SEQ.CURRVAL is not yet defined in this session
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
  </code></pre>