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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: strange behaviour of sequence

RE: strange behaviour of sequence

From: Murray, Margaret <mamurray_at_husseyseating.com>
Date: Wed, 29 Jan 2003 03:03:41 -0800
Message-ID: <F001.0053D029.20030129030341@fatcity.com>


Jp:
Is the sequence cached? Check out Note:62002.1 on Metalink - "Applications which use Oracle sequences which have the CACHE option enabled will often 'skip' values. This article discusses the cache option, why numbers can be lost and how to minimize this occurrance." You'll either want to pin it using DBMS_SHARED_POOL.KEEP (depending on your version of Oracle you may need a patch to enable pinning of sequences) or not cache it. Margaret

> -----Original Message-----
> From: oraora oraora [mailto:oraoraora_at_rediffmail.com]
> Sent: Wednesday, January 29, 2003 5:34 AM
> To: Multiple recipients of list ORACLE-L
> Subject: strange behaviour of sequence
>
>
> Guys,
>
> one of my developers is using sequence to auto-increment the value
> of a column while inserting.
>
> he has created a sequence like this.
>
> SQL > create sequence testseq start with 1;
>
> and then uses a INSERT statement as below in a JSP.
>
> insert into testtab values ('BREAD'||testseq.nextval);
>
> after some inserts .....when he does SELECT from TESTTAB...he
> finds
> the values as :
>
> BREAD1
> BREAD2
> BREAD3
> BREAD4
> BREAD21
> BREAD22
>
> it should increment by 1.but it is not so ?
>
> any hint/clue ????
>
> Regards,
> Jp.
>
>
>
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: oraora oraora
> INET: oraoraora_at_rediffmail.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Murray, Margaret
  INET: mamurray_at_husseyseating.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jan 29 2003 - 05:03:41 CST

Original text of this message

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