GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Oracle  >  Data Access

 Print  |  
Question:  how to add data from excel sheet to oracle database?



July 07, 2008 00:17:08 #5
 ammupriyaa Oracle Expert  Member Since: July 2008    Total Comments: 5 

RE: how to add data from excel sheet to oracle database?
 
Save the excel sheet as test1.csv file with 2 columns empno and ename

create or replace directory data_dir as 'C:DATA';
Place your test1.csv file

create table alpha(EMPNO    NUMBER(4),ENAME    VARCHAR2(10))
Organization external
(type oracle_loader
default directory data_dir
access parameters (records delimited by newline
fields terminated by ',')
location ('test1.csv'))
PARALLEL
REJECT LIMIT UNLIMITED;
   

INSERT INTO emp (EMPNO,ENAME) SELECT * FROM alpha;

Please try and tell whether you are getting correct answer or anyone  whether mine is correct or not ? if not please correct it.
     

 

Back To Question