Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: help in SqlLoader; NULLIF function
see answer below
> -----Original Message-----
> From: Venkatesh, Sankar (CAP, GEFA)
> [mailto:Sankar.Venkatesh_at_gecapital.com]
>
> Using Solaris and Oracle 8.1.7
>
> What is the syntax of NULLIF condition in "sqlldr ", when we
> have multiple
> null conditions for a column. I could not find the syntax for multiple
> NULLIF conditions on "Oracle8i_Utilities" manual .
>
> I want to feed the column with NULL when the input data for the column
> TerminationDate (Data datatype ) is "000000" or "999999" or
> "731014" . The
> input data being in the form "YYMMDD"
> I don't have problem running single NULLIF condition as in
> EffectiveDate
>
>
> LOAD DATA
> INTO TABLE AWW.Dealer
> (
> Dealer POSITION(01:08) CHAR(8) , > EffectiveDate POSITION(09:14) DATE(6) "YYMMDD"
> StmtSeq POSITION(56:57) CHAR(2) , > TerminationDate POSITION(58:63) DATE(6) "YYMMDD"
Use a decode for the date field.
Example:
Table T has one column, d, of type date
input file:
2002/03/04 1992/01/01 1961/08/21 2001/06/13 1950/12/31
ctl file
load data
infile 'date_test.txt'
badfile 'date_test.bad'
discardfile 'date_test.dsc'
into table t
( d position (1:10) "decode (:d, '1992/01/01', null, '2001/06/13', null, to_date (:d, 'YYYY/MM/DD'))" )
after sql*load:
SQL> set null "NULL DATE"
SQL> select to_char (d, 'YYYY/MM/DD') from t ;
TO_CHAR(D,
![]() |
![]() |