How to insert multiple data entries at a time in Oracle

Source: Internet
Author: User

 

When searching, see the followingArticleIt feels very powerful. Q: How Does Oracle insert multiple data records at a time? -[Computer] A: read all the data from a CSV file and insert it into an Oracle database. In a few minutes, there are about 0.6 million data records.
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 what the result of select '1' from dual is? By the way, the result is 1.

Second, you know

Select '1' from dual

Union

Select '2' from dual

What is the result? The result is

1

2

So the most important thing is that,

Insert into Table Name (Field 1)

Select '1' from dual

Union

Select '2' from dual

This time, two pieces of data are inserted. 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.
Good luck.

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.