Link to home
Start Free TrialLog in
Avatar of Swaminathan K
Swaminathan KFlag for India

asked on

Need help on SQL Loader for loading data

Hi Team,

I need to load the below data in to an table using sqlloader utility , Iam getting an error because of 3rd column data and 4th column data , how do i address these.

Software Programming ,Sam, ,"java
Oracle",
Software Programming ,raj,BR123,"java
Oracle",1000

Target Table
Degree varchar2(50)
StudentName varchar2(50)
PANNo VARCHAR2(40),
Courses VARCHAr2(80),
Fees number

The control file
LOAD DATA
INFILE 'D:\Data-Load\new-2013year.csv'
TRUNCATE
INTO TABLE StudentData_STG
FIELDS TERMINATED BY ','  OPTIONALLY ENCLOSED '"'
TRAILING NULLCOLS
(
Degree char(50)
StudentName char(50)
PANNo CHAR(40),
Courses CHAr(80),
Fees number
)
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

What is the error?

Is there a line break in the actual data?
Avatar of Swaminathan K

ASKER

Two problems
1. One line break
2. no data for the 3rd column . i get the below error
Record 1: Rejected - Error on table StudentData_STG column .PANNo
second enclosure string not present
Just to confirm:  there is a line break in the CSV file?  So you need to load those 4 lines into two database rows?

>>Record 1: Rejected - Error on table StudentData_STG column .PANNo

Does the log file not tell you why it was rejected?  Do you have a not null constraint or is there a Unique Index on it and there is already a row with a space in it?

>>second enclosure string not present

Not sure I understand what you mean by that.
No ,
Actually , It has to be 2 records

Software Programming ,Sam, ,"java Oracle",
Software Programming ,raj,BR123,"java Oracle",1000

Because of the line break it is comming in 2 lines .

Also , in the input record if you see , 3rd column there is no value in the first record, this is causing an issue.  There is no index or constraint on any column
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
awesome