Home » SQL & PL/SQL » SQL & PL/SQL » Sequence creation (Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production)
Sequence creation [message #575648] Fri, 25 January 2013 03:19 Go to next message
saipradyumn
Messages: 178
Registered: October 2011
Location: Hyderabad
Senior Member

Hi all ,


How to create the sequence which gives following values
1
0
1
0
1
0
when we excite the following query , it has to give the above results
select seq.nextval from dual


Thanks
SaiPradyumn

Re: Sequence creation [message #575654 is a reply to message #575648] Fri, 25 January 2013 04:11 Go to previous messageGo to next message
sss111ind
Messages: 468
Registered: April 2012
Location: India
Senior Member

CREATE SEQUENCE test_seq INCREMENT BY 1 START WITH 1 MINVALUE 0 MAXVALUE 1 CYCLE NOCACHE;
Re: Sequence creation [message #575656 is a reply to message #575654] Fri, 25 January 2013 04:36 Go to previous messageGo to next message
Michel Cadot
Messages: 58565
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why NOCACHE?
Let CACHE unless you have a very good reason to use NOCACHE.

Regards
Michel
Re: Sequence creation [message #575664 is a reply to message #575656] Fri, 25 January 2013 04:58 Go to previous messageGo to next message
saipradyumn
Messages: 178
Registered: October 2011
Location: Hyderabad
Senior Member
Thanks
Re: Sequence creation [message #575665 is a reply to message #575656] Fri, 25 January 2013 05:01 Go to previous messageGo to next message
sgollapudi
Messages: 9
Registered: January 2013
Location: HYDERABAD
Junior Member
Another way...

CREATE SEQUENCE test_seq INCREMENT BY -1 START WITH 1 MINVALUE 0 MAXVALUE 1 CYCLE NOCACHE;

Michael, We can not cache for the above sequence creation.
Re: Sequence creation [message #575668 is a reply to message #575665] Fri, 25 January 2013 05:43 Go to previous message
Michel Cadot
Messages: 58565
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Maybe one of the good reasons.

Regards
Michel
Previous Topic: forall update with bulk collect for multiple columns
Next Topic: Using Nested Table (merged)
Goto Forum:
  


Current Time: Fri Jul 25 11:13:10 CDT 2014

Total time taken to generate the page: 0.14926 seconds