Skip to Main Content

How to load cvs file into table using sql loader ?

AS08Sep 15 2022

Hi All,

I have a below table structure -
create table flt_rng
(
rngg varchar2(12), rnggfini date not null , rngffin date not null,rngcode varchar2(1),rngdescri varch2(30), fngope varchar2(2),rngfra varchar2(1),Rnggfreq varchar2(7) );

and Below is the file format-
rngg;rnggfini;rngffin;rngcode;rngdescri;fngope;rngfra;rnggfreq
ED0000;2021/11/19;2017/12/31;K;Training School;ED;N;1234569
JK0001;2021/11/19;2013/12/31;K;Training School;JK;N;1234569

The ctl file that i wrote

OPTIONS (SKIP=1)
LOAD DATA
INFILE 'DP_FMDG_20220914.csv'
REPLACE INTO TABLE flt_rng
FIELDS TERMINATED BY ";"
TRAILING NULLCOLS
( rngg,
rnggfini "TO_DATE(:rnggfini, 'YYYY/MM/DD')",
rngffin "TO_DATE(:rngffin, 'YYYY/MM/DD')",
fngcode,
rngdescri "REPLACE(TRIM(:rngdescri), ' ', '')" ,
rngope,
rngfra,
Rnggfreq
)

when i am running the ctl file getting below error -

Record 1: Rejected - Error on table flt_rng, column RNGFFIN.
ORA-01841: (full) year must be between -4713 and +9999, and not be 0

Record 2: Rejected - Error on table flt_rng, column RNGFFIN.
ORA-01841: (full) year must be between -4713 and +9999, and not be 0

Please advise what is wrong and please help me give resolution .

This post has been answered by Frank Kulash on Sep 15 2022
Jump to Answer
Comments
Post Details
Added on Sep 15 2022
3 comments
42 views