Home » RDBMS Server » Server Utilities » Loading data into database using SQL Loader (Oracle 10.2.0.4.0 ,windows)
Loading data into database using SQL Loader [message #417442] Sat, 08 August 2009 13:43 Go to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member


Hi all,

How to load data from excel file into database using sql loader?

Please advice me on this.


Regards,
Mohan
Re: Loading data into database using SQL Loader [message #417443 is a reply to message #417442] Sat, 08 August 2009 14:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Save it in CSV format and then it is easy.

Regards
Michel
Re: Loading data into database using SQL Loader [message #417444 is a reply to message #417442] Sat, 08 August 2009 14:27 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>How to load data from excel file into database using sql loader?
This is a FAQ!
SEARCH FORUM!

You need to help us by following the Posting Guidelines as stated below.
http://www.orafaq.com/forum/t/88153/0/
Go to the URL above click the link "Posting Guidelines"
Go to the section labeled "Practice" & do as directed.

[Updated on: Sat, 08 August 2009 15:12]

Report message to a moderator

Re: Loading data into database using SQL Loader [message #417449 is a reply to message #417444] Sat, 08 August 2009 23:46 Go to previous messageGo to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member



can anybody send me the script for loading data from excel into database tables using sql loader?


and also if i want to load data from excel into database tables using TOAD ,should i have to convert the excel files into csv file before loading ??


Please confirm



Regards,
Mohan
Re: Loading data into database using SQL Loader [message #417451 is a reply to message #417442] Sat, 08 August 2009 23:51 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
I am sorry to see that GOOGLE is broken for you.
Please be patient while repairs are completed.
Additional information will be posted when it becomes available.
Re: Loading data into database using SQL Loader [message #417475 is a reply to message #417449] Sun, 09 August 2009 08:44 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
CSV (comma separated values) file can be easily saved from your Excel file. Then read SQL*Loader manual (won't take long, but you'll learn a lot!).

There's no "script" one could send to you because it depends on input data, target table(s) description etc. Though, feel free to search the board - there've been plenty of nice examples here.
Re: Loading data into database using SQL Loader [message #418265 is a reply to message #417475] Thu, 13 August 2009 13:47 Go to previous messageGo to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member



I Used below script to load data
from excel sheet into database table (table1)


LOAD DATA
INFILE 'C:\mohan\August\Aug13\
3080_Remedy 99100_zdlr_op1_t.csv'
APPEND
INTO TABLE table1
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(

Column1,
Column2,
Column3,
Column4,
Column5,
Column6,
Column7,
)


I ended up with the error .Below are the errors.

SP2-0042: unknown command
"LOAD DATA" - rest of line ignored.
SP2-0734: unknown command
beginning "INFILE 'C..."
- rest of line ignored.
SP2-0004: Nothing to append.
SP2-0734: unknown command
beginning "INTO TABLE..." - rest of line ignored.
SP2-0734: unknown command
beginning "FIELDS TER..." - rest of line ignored.
SP2-0734: unknown command
beginning "TRAILING N..." - rest of line ignored.
SP2-0042: unknown command
"SAIO_CD," - rest of line ignored.
SP2-0734: unknown command
beginning "Column1..." - rest of line ignored.
SP2-0042: unknown command
"Column2," - rest of line ignored.
SP2-0734: unknown command
beginning "column3_..." - rest of line ignored


I really appreciate if someone could help me on this.


Regards,
Mohan

Re: Loading data into database using SQL Loader [message #418269 is a reply to message #417442] Thu, 13 August 2009 14:02 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
http://www.orafaq.com/forum/?SQ=cd4b0bf9426c9c0143951d0d6e0aa872&t=search&srch=csv&btn_submit=Search&field=all&fo rum_limiter=10&search_logic=AND&sort_order=DESC&author=


This is a FAQ!
SEARCH FORUM!
Re: Loading data into database using SQL Loader [message #418314 is a reply to message #418269] Fri, 14 August 2009 02:31 Go to previous messageGo to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member


Im getting error like this.

SQL*Loader-350: Syntax error at line 17.
Expecting field-name, found ")".
)
^


Here is the controlfile for sql loader.

LOAD DATA
INFILE 'C:\mohan\August\Aug13\loader.csv'
APPEND
INTO TABLE table1
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(

column1,
column2,
column3,
Change_Date "DD/MM/YYYY",
sysdate_Date "DD/MM/YYYY",

)

it would be greatful if someone could come up with the solution for this.


Thanks in advance.
Re: Loading data into database using SQL Loader [message #418319 is a reply to message #418314] Fri, 14 August 2009 03:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
sysdate_Date "DD/MM/YYYY",
)

Regards
Michel
Re: Loading data into database using SQL Loader [message #418387 is a reply to message #418319] Fri, 14 August 2009 08:28 Go to previous messageGo to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member

what is the red color indicate (,)
Re: Loading data into database using SQL Loader [message #418388 is a reply to message #418387] Fri, 14 August 2009 08:30 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
It should not be there.
Re: Loading data into database using SQL Loader [message #418389 is a reply to message #418388] Fri, 14 August 2009 08:34 Go to previous messageGo to next message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member

but the output is same Sad
Re: Loading data into database using SQL Loader [message #418390 is a reply to message #418389] Fri, 14 August 2009 08:52 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Copy and paste your log file.

Regards
Michel
Re: Loading data into database using SQL Loader [message #418461 is a reply to message #418390] Sat, 15 August 2009 15:29 Go to previous message
Mohan10g
Messages: 159
Registered: May 2009
Location: INDIA
Senior Member



The issue has been solved.I loaded data using insert statement as there was some problem (some space issue) in the data in excel sheet.


Thanks for you help.
Previous Topic: Loading from xml file to staging table in Oracle
Next Topic: SQL Loader DATE Datatype error (merged)
Goto Forum:
  


Current Time: Thu Apr 18 17:45:12 CDT 2024