Home » RDBMS Server » Server Utilities » problem in loading data from excel sheet
problem in loading data from excel sheet [message #157109] Tue, 31 January 2006 06:40 Go to next message
oradba16
Messages: 54
Registered: September 2005
Member
hi ,
i hav some problem with sqlloader.i m using oracle8i

this is my loader.ctl file

load data
infile 'c:\data\emp.xls'
into table employee
fields terminated by "," optionally enclosed by '"'
( empno, empname, sal, deptno )


now i gave this command then

$sqlldr chan/chan control=loader.ctl


it gave me the badfile emp.bad

did user need any privilage to load the file? so wat can i do now?

plz any one help me itz really urgent
Re: problem in loading data from excel sheet [message #157111 is a reply to message #157109] Tue, 31 January 2006 06:45 Go to previous messageGo to next message
Gerardo Fernandez Herrera
Messages: 58
Registered: January 2006
Location: Montevideo, Uruguay
Member
You cannot import an excel file as is.
First, save your xls as a csv, then run SQLLDR using the new file as input.

Regards.
Gerardo.
icon6.gif  Re: problem in loading data from excel sheet [message #157118 is a reply to message #157109] Tue, 31 January 2006 07:35 Go to previous messageGo to next message
oradba16
Messages: 54
Registered: September 2005
Member
HI

THIS IS MY
loader.ctl
load data
infile 'c:\data\New.csv'
into table new
fields terminated by "," optionally enclosed by '"'
(name,emailid,city )


WHEN I GAVE

$sqlldr hemu/hemu control=loader.ctl log=loader.log

SQL*Loader: Release 8.1.7.3.0 - Production on Tue Jan 31 20:32:28 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Commit point reached - logical record count 31

"Actually here it says some commit point reached when i gave"

query

select * from new;

no rows selected.
no rows get loaded there.
...................................................................
when i cat the loader.log I GOT SOME ERROR WHAT WRONG WITH MY APPROACH
$ cat loader.log

SQL*Loader: Release 8.1.7.3.0 - Production on Tue Jan 31 20:32:28 2006

(c) Copyright 2000 Oracle Corporation. All rights reserved.

Control File: loader.ctl
Data File: /export/home/oracle8i/New.csv
Bad File: New.bad
Discard File: none specified

(Allow all discards)

Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array: 64 rows, maximum of 65536 bytes
Continuation: none specified
Path used: Conventional

Table NEW, loaded from every logical record.
Insert option in effect for this table: INSERT

Column Name Position Len Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
NAME FIRST * , O(") CHARACTER
EMAILID NEXT * , O(") CHARACTER
CITY NEXT * , O(") CHARACTER

Record 1: Rejected - Error on table NEW, column NAME.
Field in data file exceeds maximum length
Record 3: Rejected - Error on table NEW, column EMAILID.
Column not found before end of logical record (use TRAILING NULLCOLS)
Record 4: Rejected - Error on table NEW, column EMAILID.

Table NEW:
0 Rows successfully loaded.
31 Rows not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.


Space allocated for bind array: 49536 bytes(64 rows)
Space allocated for memory besides bind array: 0 bytes

Total logical records skipped: 0
Total logical records read: 31
Total logical records rejected: 31
Total logical records discarded: 0

Run began on Tue Jan 31 20:32:28 2006
Run ended on Tue Jan 31 20:32:28 2006

Elapsed time was: 00:00:00.33
CPU time was: 00:00:00.
........................................................................

FIRST TIME I M USING SQL LOADER SO CAN ANY ONE TELL ME WATS THE ERROR HERE. AND HOW TO SOLVE THIS PROBLEM

PLZ HELP ME REALLY VERY URGENT..
Re: problem in loading data from excel sheet [message #157120 is a reply to message #157118] Tue, 31 January 2006 07:42 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Quote:

Record 1: Rejected - Error on table NEW, column NAME.
Field in data file exceeds maximum length
Record 3: Rejected - Error on table NEW, column EMAILID.
Column not found before end of logical record (use TRAILING NULLCOLS)

As you can see
see NAME column is improperly defined. The values you are loading are bigger than it is defined to hold.
And use trailing nullcols if the last column is nullable.
Search the forum for examples. Read documentation.
Check here for a quickstart.
http://www.orafaq.com/faq/sql_loader
Re: problem in loading data from excel sheet [message #157122 is a reply to message #157118] Tue, 31 January 2006 07:47 Go to previous message
Gerardo Fernandez Herrera
Messages: 58
Registered: January 2006
Location: Montevideo, Uruguay
Member
Take a look at your error messages, as
Quote:

Record 1: Rejected - Error on table NEW, column NAME.
Field in data file exceeds maximum length


so you can have an idea of what's going on

I think you should read this manual first, then you'll learn the basic stuff.

Regrads.
Previous Topic: Invoking SQLLDR from Concurrent Program
Next Topic: SQL Loader / Eliminate Trailing Last Record
Goto Forum:
  


Current Time: Tue Jul 02 04:44:15 CDT 2024