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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Sequence in SQL-LOADER

Re: Sequence in SQL-LOADER

From: Maxim Demenko <mdemenko_at_arcor.de>
Date: Wed, 28 Feb 2007 13:22:43 +0100
Message-ID: <45E57413.10509@arcor.de>


Robert Klemme schrieb:

> On 28.02.2007 12:16, pankaj_wolfhunter_at_yahoo.co.in wrote:

>> Greetings,
>> I am using sequence in sql-loader to insert unique
>> values in a table.
>>
>> ctl file (Demo):
>>
>> LOAD DATA
>> INFILE 'test.dat'
>> APPEND
>> INTO TABLE test_loader
>> FIELDS TERMINATED BY "|"
>> OPTIONALLY ENCLOSED BY '"'
>> (
>> name char,
>> loadseq SEQUENCE(MAX,5)
>> )
>>
>> I want my value to start from 5 and thereafter get incremented by 1
>> every time.
>> But for now its getting incremented by 5?
>>
>> Is any there any way in sql-loader or any other to achieve this?
>>
>> DB Version:
>> Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
>> PL/SQL Release 9.2.0.6.0 - Production
>>
>> Help would be appreciated.
> 
> You probably fell victim of sequence caching.  You could switch off 
> caching but this is inefficient if you have several concurrent imports.
> 
> Regards
> 
>     robert

Please, read the manual for utilites you are trying to use. http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1008321

What you are actually doing is
SEQUENCE(MAX,5) means, you start from the maxvalue available in the table for this column (plus increment) and increment your sequence by 5. If you would want to start with 5 and increment by 1, you should write SEQUENCE(5,1) or simply SEQUENCE(5), because increment by 1 is default.

Best regards

Maxim Received on Wed Feb 28 2007 - 06:22:43 CST

Original text of this message

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