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: sql loader problem

RE: sql loader problem

From: david wendelken <davewendelken_at_earthlink.net>
Date: Thu, 22 Jul 2004 10:58:13 -0400 (GMT-04:00)
Message-ID: <16716353.1090508293810.JavaMail.root@beaker.psp.pas.earthlink.net>


(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
    RECNUM batchrecnum works like a charm.

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...



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
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

Original text of this message

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