Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: question about sequences.
On Sun, 16 Feb 2003, kennedy-downwithspammersfamily_at_attbi.com wrote:
> It is the type of thing that would happen in real life (some bozo did
> an insert into dual and now it has 2 rows, and is creating all sorts
> of havoc.)
I didn't know this could happen so I tried it.
SQL> create sequence test_seq;
Sequence created.
SQL> select test_seq.nextval from dual;
NEXTVAL
1
SQL> select * from dual;
D
-
X
SQL> insert into dual values ('A');
1 row created.
SQL> select * from dual;
D
-
X
SQL> select test_seq.nextval from dual;
NEXTVAL
2
SQL> select test_seq.currval from dual;
CURRVAL
2
How can I get two rows back? (Not that I would do this in actual code, but I'd like to know how to make it happen)
I would have answered that question, "Can't happen".
-- Galen deForest Boyer Sweet dreams and flying machines in pieces on the ground.Received on Tue Mar 04 2003 - 21:07:12 CST