Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: sql loader problem
(Sorry, sent this out under the wrong header)
Now that data loads, I can't figure out how to do one thing.
Two batch identification columns,
batchid
batchrecnum
batchid should have the same value for each record loaded in the same sqlldr run. batchrecnum should start at 1 for each sqlldr run, and increment by 1.
So, here's the relevant portion of the control file:
(BATCHID
EXPRESSION "NVL(BATCHID_SEQ.CURRVAL,BATCHID_SEQ.NEXTVAL)",BATCHRECNUM
I didn't actually expect a reference to the sequence currval to work like this (before a reference to nextval first), but it didn't raise an error. (I just hoped to illustrate clearly what I wanted.) However, the data loaded! But, it gives me the next value from the sequence for each new record.
So, instead of getting, in one load (where the next value of batchid_seq would be 5:
5,1 5,2 5,3 5,4
I'm getting,
5,1 6,2 7,3 8,4
Any ideas, besides hard-coding the batchid value for the run into the sqlldr control file? I don't want to do that...
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Thu Jul 22 2004 - 09:55:21 CDT
![]() |
![]() |