Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL*Loader question
Use a TRAILING NULLCOLS option. (see below)
In article <6phkmr$45$1_at_nuscc.nus.edu.sg>,
scip6125_at_leonis.nus.sg (Zhao Fu) wrote:
> I am using SQL*Loader to load a medical datafile into an Oracle table. The
> data format is like this:
> "Robert","19540823","lung and liver","19970418","Dr.Smith",...
>
> My control file is like this:
>
> load data
> infile 'somefile''
> badfile 'dt.bad'
> replace
> into table old_sum
> fields terminated by "," optionally enclosed by '"'
> TRAILING NULLCOLS
> (NAME,
> BIRTHDATE date 'YYYYMMDD',
> CANCER SITE,
> DEATHDATE date 'YYYYMMDD' ,
> DOCTOR_NAME,
> ...
> )
>
> but there are a lot of missing data in the field DEATHDATE, the field is
> thus empty, so the above record might be like this:
> "Robert","19540823","lung and liver","","Dr.Smith",...
>
> So, I added NULLIF DEATHDATE=BLANKS into the control file, but those
> records with missing DEATHDATE still cannot be loaded. In addition, if a
> character field data is missing, using NULLIF clause still cannot replace
> the column into null, but they turn out to be blanks with the maximum
> length of this varchar2 column.
>
> Anyone knows what's wrong with this?
>
> TIA
>
> Zhao Fu
> School of computing
> National Univeristy of Singapore
> zhaofu_at_comp.nus.edu.sg
>
> --
>
>
-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Mon Jul 27 1998 - 09:58:47 CDT
![]() |
![]() |