Sequence Error ORA-02287

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • james.kennedy@students.plymouth.ac.uk

    Sequence Error ORA-02287

    Hi,

    After an insert using nextval I try:


    SELECT * FROM tblClients WHERE fldclient_id = (SELECT
    client_id_seq.c urrval from Dual)


    and get:


    java.sql.SQLExc eption: ORA-02287: sequence number not allowed here


    I've read lots on sequence's etc and I can't see why I cant get the
    currval.
    (I'm in Jdeveloper btw)

    Thanks,

    Jim.

  • jfk303

    #2
    Re: Sequence Error ORA-02287


    Thanks for the reply,

    Sorry if this is more of a Java question rather than o.d:

    Ok, I'm now putting the currrval into a variable. My query returns a
    RecordSet, could anyone tell me how to get the value from the RecordSet
    into a variable.

    Whats wrong with this:

    RecordSet myResults = DatabaseConnect ion.ExecuteQuer y("SELECT
    my_seq.currval FROM DUAL");

    int currentValue = myResults.getIn t("my_seq.currv al");

    Thanks for any answers,

    Jim

    Comment

    Working...