Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: View current seq. no.

Re: View current seq. no.

From: Shirley Kwan <sskwan_at_ingr.com>
Date: Thu, 13 May 1999 13:37:09 +0800
Message-ID: <4hABYJQn#GA.203@pet.hiwaay.net>


Hi Dante,

Please see my response below......have a nice day !!!

Shirley Kwan......
Software Engineer
Post-sale Team
Intergraph Hong Kong Limited
Telephone #: (852)2593-1645
mailto:SSKwan_at_ingr.com
http://www.intergraph.com/

>Shirley,
> sorry I can't agree with your last statement.
>
> of course you can review the current value.
>
> It is important to understand that you have
> a current value for each session using the
> sequence and a current value for the DB instance.
(Shirley reply) I agree !!!
>
> If user A and user B use the sequence, first A, then B,
> then A and then B again and so on ... having cache 10
> (as an example) defined, you would have
>
> A:1 B:11 A:2 B:12 A:3

(Shirley reply) If two users use the same sequence (increment by 1) with cache size 10, the result should be like this in usual way: A:1 B:2 A:3 B:3 A:4
> so what would you expect here to have as the current value ?
> 3 or 12 ?

(Shirley reply) So the current value of the sequence of user A's session is 4, the current value of the sequence of user B's session is 3, the current value of the sequence of DB instance is 4,
>
> For A it would be 3, for B it would be 12 and for user
> C looking at the instance it would be 19
(Shirley reply) User C is looking at the sequence of the DB instance with next available value 5.
So, if we retrieve the last_number of a sequence with no cache value, it will be the next available value of that sequence. But I have no idea on how to determine the next available value with cache value n.
I think we don't have a way to do so, what do you think ???
>
>Regards
>Dante

Dante wrote in message <7h66vj$nla$1_at_nnrp1.deja.com>...
>Shirley,
> sorry I can't agree with your last statement.
>
> of course you can review the current value.
>
> It is important to understand that you have
> a current value for each session using the
> sequence and a current value for the DB instance.
>
> If user A and user B use the sequence, first A, then B,
> then A and then B again and so on ... having cache 10
> (as an example) defined, you would have
>
> A:1 B:11 A:2 B:12 A:3
>
> so what would you expect here to have as the current value ?
> 3 or 12 ?
>
> For A it would be 3, for B it would be 12 and for user
> C looking at the instance it would be 19
>
>Regards
>Dante
>In article <b4kkf7nm#GA.154_at_pet.hiwaay.net>,
> "Shirley Kwan" <sskwan_at_ingr.com> wrote:
>> Yes, it's correct.
>> So it means that we don't have a way to review the current value of
>the
>> sequence unless the cache size is zero !!!
>>
>> Shirley......
>>
>> Dante wrote in message <7gvcff$ntn$1_at_nnrp1.deja.com>...
>> >Shriley,
>> > then you should define what you identify as "current value".
>> >
>> > LAST_NUMBER would give you the DB wide last sequence number
>> > fetched, while sequence.curval would give you the current
>> > sequence number of your session.
>> >
>> > The difference is important and it depends what you are
>> > trying to accomplish.
>> >
>> > Imagine having cache 10, user A fetches, user B fetches
>> > for user A it might be 1, for B it might be 11,
>> > but the DB can only guarantee that 20 was the last
>> > fetched ... if B uses all 10 sequences or not.
>> >
>> > The real USED last sequence can only be derived from the
>> > target you stored the sequence into.
>> >
>> >Regards
>> >Dante
>> >In article <eZHYaFCm#GA.154_at_pet.hiwaay.net>,
>> > "Shirley Kwan" <sskwan_at_ingr.com> wrote:
>> >> LAST_NUMBER shows the current value only if no cache is used !!!
>> >>
>> >> Prabhakar Narayanan wrote in message
><37312F01.755CC94E_at_clsasia.com>...
>> >> >Hi
>> >> >
>> >> >You can access USER_SEQUENCES table
>> >> >
>> >> >SELECT SEQUENCE_NAME, LAST_NUMBER
>> >> >FROM USER_SEQUENCES
>> >> >
>> >> >This should give you the desired result
>> >> >
>> >> >Regards
>> >> >
>> >> >N.Prabhakar
>> >> >
>> >> >
>> >> >Shirley Kwan wrote:
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> Does anyone know that how to view all current value of all
>sequences
>> >> without
>> >> >> changing the value ???
>> >> >>
>> >> >> Thanks in advance !!!
>> >> >>
>> >> >> Shirley......
>> >> >
>> >>
>> >>
>> >
>> >-----------== Posted via Deja News, The Discussion Network ==--------
>--
>> >http://www.dejanews.com/ Search, Read, Discuss, or Start Your
>Own
>>
>>
>
>
>--== Sent via Deja.com http://www.deja.com/ ==--
>---Share what you know. Learn what you don't.---
Received on Thu May 13 1999 - 00:37:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US