Re: anyone seen this weirdness with sequences in 11gr2?

  • From: Robert Freeman <robertgfreeman@xxxxxxxxx>
  • To: TESTAJ3@xxxxxxxxxxxxxx
  • Date: Thu, 8 Apr 2010 14:26:30 -0700 (PDT)

Try to create the sequence using the start with syntax, does it do the same 
thing? I tried this on  11.2 also and got the same results. Sounds like a bug 
to me.

I do notice that if you do a select c_seq.nextval from dual; on the second 
sequence creation that is seems to work, which is weird.

It's a bug I'm betting.

RF

 Robert G. Freeman
Master Principal Consultant, Oracle Corporation
Oracle ACE
Author:
Oracle Database 11g RMAN Backup and Recovery (Oracle Press) - ON ITS WAY SOON!
OCP: Oracle Database 11g Administrator Certified Professional Study Guide 
(Sybex)
Oracle Database 11g New Features (Oracle Press)
Oracle Database 10g New Features (Oracle Press)
Other various titles
Blog: http://robertgfreeman.blogspot.com




________________________________
From: "TESTAJ3@xxxxxxxxxxxxxx" <TESTAJ3@xxxxxxxxxxxxxx>
To: oracle-l@xxxxxxxxxxxxx
Sent: Thu, April 8, 2010 2:22:08 PM
Subject: anyone seen this weirdness with sequences in 11gr2?


This works correctly in 11gr1: 

SQL> drop sequence c_seq; 

Sequence dropped. 

SQL> create sequence c_seq nocache; 

Sequence created. 

SQL> select c_seq.nextval from dual; 

   NEXTVAL 
---------- 
         1 

SQL> 
SQL> drop sequence c_seq; 

Sequence dropped. 

SQL> create sequence c_seq nocache; 

Sequence created. 

SQL> drop table x; 

Table dropped. 

SQL> create table x(x number); 

Table created. 

SQL> insert into x(x) values(c_seq.nextval); 

1 row created. 

SQL> commit; 

Commit complete. 

SQL> select * from x; 

         X 
---------- 
         2 


The question is why from the c_seq.nextval
WITHIN an insert do I get back a 2 instead of a 1 like if i did it OUTSIDE
of an insert. 

this works correctly in 11gr1. 

thanks, joe 

_______________________________________
Joe Testa, Oracle Certified Professional 
Senior Engineering & Administration Lead
(Work) 614-677-1668
(Cell) 614-312-6715

Other related posts: