DBAsupport.com Forums - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: sequences

  1. #1
    Join Date
    Feb 2000
    Location
    NJ, United States
    Posts
    250

    Question

    Is there a data dictionary view stores the *start with* value of the sequence? In dba_sequences we have only min value column which is mostly 1 or atleast not equal to start with.

    THis value is captured by tools like SQL Navigator,Toad etc but where do they get this value from??

    Thanx in advance,
    Kavita)



    KN

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Good question. Its not in sys.obj$ or sys.seq$....
    Jeff Hunter

  3. #3
    Join Date
    Feb 2000
    Location
    NJ, United States
    Posts
    250

    Unhappy

    It's ironical there are no views related to sequences which stores this value!! how is it possible, where do the tools get this value from...???????????????? Any answers???
    KN

  4. #4
    Join Date
    Apr 2001
    Posts
    47
    Hi Kavita!

    You wrote:

    THis value is captured by tools like SQL Navigator,Toad etc but where do they get this value from??


    I was wondering how did you make it out? I mean that these tools can capture it? I tried to see "start with" value in SQLNavigator and DBA studio (I do not have TOAD) for a sequence and I did not see it anywhere.

    There is implicit way to see how they resolve it:
    If you try to extract DDL for a sequence in SQL Navigator, it shows "start with" value as a current value of LAST_VALUE column of user_\all_\dba_sequences view.
    If you try to create it in DBA Studio using "Create like..." option, it uses value of MIN_VALUE column of the mentioned view for "start with" clause.

    So, my hunch is that Oracle does not store this value at all.
    Though I can be wrong...

    Regards,

  5. #5
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Dimitri is correct. When you initially create the sequence, oracle would store the start with value as the last number. In the SYS.SEQ$ table. Then when to keep calling the values this gets altered to the current value. That is how your sequence start-with is maintained. when you alter the value of start-wit, the last number colume of that perticular sequece get updated.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  6. #6
    Join Date
    Feb 2000
    Location
    NJ, United States
    Posts
    250
    when you look for properties of sequence it shows u the start value but I am not sure if it is the start value we speciy on create time.
    Basically i want to know what is the value (and where is that value stored) which it will start when i import a sequence from an export file.

    Thanx in advance
    KN

  7. #7
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    If you get to check the seq. last value from the DBA_SEQUENCE and the start value of the sequence script. they would either be 1 number apart or the same. I'm not exactly which holds. If not please, let me know, I'm very interested on getting to know more on this...

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  8. #8
    Join Date
    Feb 2000
    Location
    NJ, United States
    Posts
    250
    Then when to keep calling the values this gets altered to the current value. That is how your sequence start-with is maintained. when you alter the value of start-wit, the last number colume of that perticular sequece get updated-Sambavan


    You mean to say there is no way you can find out the value you started the sequence!!!
    KN

  9. #9
    Join Date
    Feb 2000
    Location
    NJ, United States
    Posts
    250
    Ya You guys are right, the tools take the value from the last number for DDL's.

    Thanx a lot,
    Kavita
    KN

  10. #10
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Originally posted by Knarayan
    You mean to say there is no way you can find out the value you started the sequence!!!
    It would appear not. (I'm sure jmodic will prove me wrong, though)
    Jeff Hunter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width