help regarding sql loader

From: <amitabh.mehra_at_gmail.com>
Date: Wed, 16 Jan 2008 20:36:44 -0800 (PST)
Message-ID: <458d59d9-76ba-4fc6-ab18-884a6ec4ec19@k2g2000hse.googlegroups.com>


Hi

I have a table Test:

      id       number     default -999
      occ varchar2(25) default 'student'
      addr varchar2(25)
      qual   varchar2(100)
      secid  varchar2(25) default 'h-000'

primary key: id, occ, secid

I am using sql loader to load data into the table. The ctrl file is : LOAD DATA
INFILE 'C:/record_dir/log/bad/out/test.dat' APPEND INTO TABLE Test
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '|'
TRAILING NULLCOLS
(ID CHAR( 40 ),OCC, ADDR, QUAL, SECID CHAR(25)) My test input is something like:

1,asst,abc,xyz,,
2,asst,abc,xyz,,
,,klm,abc,xyz,,


The problem is that sql loader throws error in log file: Record 1: Rejected - Error on table TEST, column SECID . ORA-01400: cannot insert NULL into ("TEST"."SECID ")

Its just not putting default values for the null values. Is there some way this can be done? Please dont ask me to change the model. Its what I have to work with :(

Thanks
Amitabh Received on Wed Jan 16 2008 - 22:36:44 CST

Original text of this message