Can I load rows from an excel sheet to a database table in BULK

888 Views Asked by At

I have to INSERT 500 rows to a table in Oracle 11g. I am using the below command one-by-one.Can I do it all at a time?

for e.g. what I am doing now-

INSERT INTO bonus SELECT ename, job, sal, comm FROM emp
   WHERE comm > sal * 0.25;
...
INSERT INTO emp (empno, ename, job, sal, comm, deptno)
   VALUES (4160, 'STURDEVIN', 'SECURITY GUARD', 2045, NULL, 30);
...
INSERT INTO dept
   VALUES (my_deptno, UPPER(my_dname), 'CHICAGO');

Thanks,

3

There are 3 best solutions below

2
On BEST ANSWER

I would export my Excel table in CSV format, and use search and replace, using regular expressions, in an editor to substitute each line of comma separated values for an INSERT command, and then run those commands.

2
On

Download SQL Developer. It has a nice function to insert into a table from an Excel spreadsheet.

2
On

Look into SQLLoader.

This sentence left intentionally blank.