Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> sequence currval

sequence currval

From: Mattias Malmgren <a2matmal_at_ulmo.stud.slu.se>
Date: Sun, 12 Sep 1999 12:49:38 +0200
Message-ID: <37DB8541.E6DD8638@ulmo.stud.slu.se>


Hello

User's manual says:

This example selects the current value of the employee sequence: SELECT empseq.currval

    FROM DUAL; I don'n understand. Way "FROM DUAL" ???

I have got a table with pimary keys. I insert into that tabel by:

   INSERT INTO flfraga (id,
   VALUES (flfraga_seq.NEXTVAL);

Later in my stored procedure I what to access the flfraga_seq.CURRVAL and store it
in a variable:

select flfraga_seq.CURRVAL into k;

Now, that doesn't work. Nor does select flfraga_seq.CURRVAL into k from dual;
or select flfraga_seq.CURRVAL into k from flfraga;

Must i first insert the flfraga_seq.CURRVAL into a special tabel and then select it????
The I coud just as well use select max(id) into k from flfraga ;

 / Mattias Received on Sun Sep 12 1999 - 05:49:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US