Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> problem with sequence plz help!!!!!!!

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: problem with sequence plz help!!!!!!!
 Jayanta  Posted: Nov 12, 2006 04:01:05 PM

 Total Post: 479
 Joined: Feb, 2006






 hello everybody!

i have created a sequence named'test1_sq' with the following commands:

SQL> create sequence test1_sq
2 start with 1
3 increment by 1
4 maxvalue 10
5 minvalue 1
6 cache 3
7 nocycle;
Sequence created.

oracle study mat saying that the "last_number" column displays the next available sequence number if nocache is specified.
but my creation script contains "cache 3"
still my query with last_number returns the next available sequence number:

SQL> select sequence_name,last_number from user_sequences where sequence_name='TEST1_SQ'

SEQUENCE_NAME LAST_NUMBER
------------------------------ -----------
TEST1_SQ 4
SQL>


may i know the reason why?????
please help!!!!



i am using oracle 9i rel 2 on windows xp with servicepack2.

 snehalatha
Posted: Nov 13, 2006 12:34:17 AM  

 Total Post: 169
 Joined: Apr, 2006






 
CACHE specifies how many values of the sequence Oracle preallocates and keeps in memory for faster access.

If you specify the CACHE Last_number would be 4
If you won't specify the CACHE last_number displays the next available sequence number.

 Jayanta
Posted: Nov 13, 2006 02:54:01 PM  

 Total Post: 479
 Joined: Feb, 2006






 
THANKS A LOT SNEHALATA.
BYE

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi333
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software