문제

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,

도움이 되었습니까?

해결책

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.

다른 팁

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

Look into SQLLoader.

This sentence left intentionally blank.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top