Stored Procedures: insert 1000 records cyclically, and 1000 stored procedures

Source: Internet
Author: User

Stored Procedures: insert 1000 records cyclically, and 1000 stored procedures

PS: Today, Brazil is abused again. I dreamed it was and woke up.
Mysql> delimiter $ mysql> create procedure p3 ()-> modifies SQL data-> BEGIN-> set @ I = 0;-> set @ max = 100; -> while @ I <@ max do-> insert into user values (@ I);-> set @ I = @ I + 1;-> end while; -> end $

80 thousand records are inserted cyclically in the oracle stored procedure using FORLOOP. After running, it is found that ORACLE is stuck but the records have been correctly written.

It is generally used in China. Our company's DBA 80% has no certification. What is important is technology and experience.
Even if you want to take the test after a year and a half, you will not be able to take the test.
Still hard to find

How can 100 records be inserted cyclically in the SQL database? Is stored procedure required?

Declare @ a as int
Set @ a = 1
While (@ a <= 100)
Begin
Insert into table1 values ('','','','')
Set @ a = @ a + 1
If @ a> 100
Break
Else
Continue
End

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.