Home » SQL & PL/SQL » SQL & PL/SQL » How to transfer data from EXCEL to ORACLE
How to transfer data from EXCEL to ORACLE [message #9958] Wed, 17 December 2003 06:08 Go to next message
sancha
Messages: 31
Registered: October 2003
Member
Hi All,

I need to transfer data from MS-EXCEL to ORACLE.

Please suggest some way to transfer this data into oracle.

Thanks in anticipation.
Re: How to transfer data from EXCEL to ORACLE [message #9960 is a reply to message #9958] Wed, 17 December 2003 06:19 Go to previous messageGo to next message
Art Metzer
Messages: 2480
Registered: December 2002
Senior Member
You'll save the Excel spreadsheet as a CSV (comma-separated values) file, then use SQL*Loader to import that file into a pre-existing database table.

Your SQL*Loader file (say it's called "loademp.ctl") might look like
LOAD DATA                                                                                                        
INFILE 'was_excel.csv'                                                                                
TRUNCATE                                                                                                         
INTO TABLE scott.emp                                                                                
FIELDS TERMINATED BY ","                                                                                         
OPTIONALLY ENCLOSED '"'                                                                                          
TRAILING NULLCOLS (    
    empno                       NULLIF empno=BLANKS     "TRIM(:empno)"   
,   ename                       NULLIF ename=BLANKS     "TRIM(:ename)"   
,   job                         NULLIF job=BLANKS       "TRIM(:job)"     
,   mgr                         NULLIF mgr=BLANKS       "TRIM(:mgr)"     
,   hiredate DATE 'MM/DD/YYYY'  NULLIF hiredate=BLANKS  "TRIM(:hiredate)"
,   sal                         NULLIF sal=BLANKS       "TRIM(:sal)"     
,   comm                        NULLIF comm=BLANKS      "TRIM(:comm)"    
,   deptno                      NULLIF deptno=BLANKS    "TRIM(:deptno)"                                       
)
Then, from the UNIX, prompt, you'd type
sqlldr scott/tiger control=loademp.ctl
For more SQL*Loader options, see the documentation link I've provided.

Hope this helps,

A.
Re: How to transfer data from EXCEL to ORACLE [message #10032 is a reply to message #9958] Wed, 24 December 2003 01:32 Go to previous messageGo to next message
Sameer
Messages: 60
Registered: March 1998
Member
U CAN USE SQL Loader UTILITY
Re: How to transfer data from oracle to excel [message #11735 is a reply to message #9960] Sat, 10 April 2004 07:18 Go to previous message
KrishnaMohan
Messages: 1
Registered: April 2004
Junior Member
Hi,
I would like to know how to transfer data from oracle to excel using sql*plus reports.
Previous Topic: Select Not Null Value
Next Topic: Print query result from SQL*plus to printer
Goto Forum:
  


Current Time: Fri Apr 19 17:12:46 CDT 2024