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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to sync. sequence number and SQL*Loader input?

Re: How to sync. sequence number and SQL*Loader input?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 15 May 1998 16:04:29 GMT
Message-ID: <355c677f.3280957@192.86.155.100>


A copy of this was sent to Zeus Ng <zeusng_at_ibm.net> (if that email address didn't require changing) On Fri, 15 May 1998 12:40:56 +1000, you wrote:

>I have a table which got a numeric field. The value is obtained from a
>sequence number.
>
>Table TBLA (F1 number(8,0), F2 varchar2(50))
>Sequence SEQ1 min. 1 increament by 1
>
>Usual update method
>insert into TBLA values (SEQ1.nextval, 'XXX');
>
>Now, I want to use SQL*Loader to load data (from another system) into
>this table. Can I instruct SQL*Loader to use the sequence number? If
>not, can I use the MAX function from SQL*Loader to insert the records
>first and sync. the sequence afterward?
>
>Zeus
>------------------------------------
>To send reply via mail, remove nospam from address

Something like:

...
x char(500) "nvl(:x,my_seq.nextval)", ...

in the .ctl file will do it. You can apply any sql function you want on the way in. You can refer to all columns in the row by using bind variable conventions (:x for example)...  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Fri May 15 1998 - 11:04:29 CDT

Original text of this message

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