Oracle inserts multiple data records at a time

Source: Internet
Author: User


Insert into Table Name (Field 1, Field 2) select '1', '2' from dual union all select '3', '4' from dual union all select '5 ', '6' from dual union all select '7', '8' from dual union all select '9', '10' from dual reads all data from a CSV file, it is inserted into an Oracle database and completed in a few minutes. There are about 0.6 million entries. Someone said on the Internet that you can insert thousands of records in a loop and then insert them into the Commit file. I rely on it. Try it on your own !! If you have never tried it, do not mislead others. Some people have said that Oracle does not support multiple inserts at a time. I rely on it. Why don't you say that you are not skillful at learning? Now I want to introduce you to the following tips: in Oracle, there is a strange table named Dual. We need to use this Dual to make an article. First, do you know the result of select '1' from dual? By the way, the result is 1. Secondly, do you know what the result of select '1' from dual union select '2' from dual? For the bird, the result is 1 2, so the most critical point is the insert into Table Name (Field 1) select '1' from dual union select '2' from dual then two pieces of data are inserted this time. Of course, if the full field is inserted (Field 1), it can be omitted. The final practice proves that if 0.6 million Insert statements are cyclically executed, the execution will not be completed in an hour (of course, the machine may be too bad), and the execution will be combined into 1000 Select statements and inserted again, the time for inserting 0.6 million data records is 20 minutes, and the time for inserting 5000 data records is 12 minutes. 3 pieces by author

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.