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: sequenceS REPLICATION

Re: sequenceS REPLICATION

From: Yechiel Adar <adar76_at_inter.net.il>
Date: Mon, 11 Oct 2004 21:25:00 +0200
Message-ID: <028301c4afc8$01183460$c701a8c0@sys3>


Let say you want you sequence to be 1000, so you do it by alter sequence:

spool inc_seq.sql
select 'alter sequence myseq increment by '

   || 1000 - currval.myseq || ';' from dual; select 'select nextval.myseq from dual;' from dual; select 'alter sequence myseq increment by 1;' from dual; spool off
@inc_seq.sql

Do not forget all the set option off you need to get clean script in the sql file. Also do some testing because I am sure there should be -1 somewhere in the first alter sequence.

you can also drop the sequence and simply build a new one with MINVALUE 1000.

Yechiel Adar
Mehish

--
http://www.freelists.org/webpage/oracle-l
Received on Mon Oct 11 2004 - 13:32:16 CDT

Original text of this message

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