Return-Path: <root@fatcity.cts.com>
Received: from ensim.rackshack.net (root@localhost)
 by orafaq.net (8.11.6/8.11.6) with ESMTP id h0U5vhf13046
 for <oracle-l@orafaq.net>; Wed, 29 Jan 2003 23:57:43 -0600
X-ClientAddr: 209.68.248.164
Received: from newsfeed.cts.com (newsfeed.cts.com [209.68.248.164])
 by ensim.rackshack.net (8.11.6/8.11.6) with ESMTP id h0U5vhm13041
 for <oracle-l@orafaq.net>; Wed, 29 Jan 2003 23:57:43 -0600
Received: from fatcity.UUCP (uucp@localhost)
 by newsfeed.cts.com (8.9.3/8.9.3) with UUCP id SAA40266;
 Wed, 29 Jan 2003 18:41:12 -0800 (PST)
Received: by fatcity.com (26-Feb-2001/v1.0g-b72/bab) via UUCP id 0053E064; Wed, 29 Jan 2003 17:48:47 -0800
Message-ID: <F001.0053E064.20030129174847@fatcity.com>
Date: Wed, 29 Jan 2003 17:48:47 -0800
To: Multiple recipients of list ORACLE-L <ORACLE-L@fatcity.com>
X-Comment: Oracle RDBMS Community Forum
X-Sender: Sony kristanto <Sony@polyfincanggih.com>
Sender: root@fatcity.com
Reply-To: ORACLE-L@fatcity.com
Errors-To: ML-ERRORS@fatcity.com
From: Sony kristanto <Sony@polyfincanggih.com>
Subject: RE: strange behaviour of sequence
Organization: Fat City Network Services, San Diego, California
X-ListServer: v1.0g, build 72; ListGuru (c) 1996-2001 Bruce A. Bergman
Precedence: bulk
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi Oraora,

I try the same thing like you did,

SQL> create sequence testseq start with 1;

Sequence created.

SQL> create table testtab (text char(10));

Table created.

SQL> begin
  2    for i in 1 .. 5 loop
  3      insert into testtab values('BREAD'||testseq.nextval);
  4    end loop;
  5    commit;
  6  end;
  7  /

PL/SQL procedure successfully completed.

SQL> select * from test;

TEXT
----------
BREAD1
BREAD2
BREAD3
BREAD4
BREAD5

Just recheck your script, pls.

Rgrds,

Sony

> -----Original Message-----
> From:	oraora  oraora [SMTP:oraoraora@rediffmail.com]
> Sent:	Wednesday, January 29, 2003 5:34 PM
> 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@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@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: Sony kristanto
  INET: Sony@polyfincanggih.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@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).

