Home » RDBMS Server » Server Utilities » sequence (sqlloader)
sequence [message #516296] Sat, 16 July 2011 04:40 Go to next message
rajendaroracle
Messages: 80
Registered: May 2011
Location: India
Member

Hi,

Every time sequence should be start from 1.can i know how to create sequence?
for ex:-once i have uploaded 100 records this time sequence is generating from 1 to 100.next time i will upload again 100 records this time sequence is generating(Starting) from 200 to 300.but it should be generate from 1. how?
i have created like this
CREATE SEQUENCE XX_SEQUENCE
MINVALUE 1
MAXVALUE 99999999999
START WITH 1
INCREMENT BY 1
CYCLE
NOCACHE;
Re: sequence [message #516299 is a reply to message #516296] Sat, 16 July 2011 05:08 Go to previous messageGo to next message
John Watson
Messages: 8922
Registered: January 2010
Location: Global Village
Senior Member
Well, one answer would be
alter sequence XX_SEQUENCE maxvalue 100;

but I don't think that is really what you want. I don't know what you are actually trying to achieve, but if it is anything to do with getting predictable, repeatable, results then a sequence may not be the correct approach.
Rgds, John.

Re: sequence [message #516316 is a reply to message #516299] Sat, 16 July 2011 11:25 Go to previous message
Barbara Boehmer
Messages: 9077
Registered: November 2002
Location: California, USA
Senior Member
I see that you listed sqlloader where your version belongs. So, I gather that you are trying to load the data using SQL*Loader and want the sequence to start at 1 for each load. So, instead of using a sequence created in SQL, you should use a SQL*Loader sequence. In your control file, just use the keyword sequence instead of using xx_sequence.nextval.
Previous Topic: Migrate 10gR2 to 11gR2 on a different server
Next Topic: SQL*Loader lowercase insert
Goto Forum:
  


Current Time: Thu Mar 28 15:34:50 CDT 2024