Oracle cyclic statement triggers

Source: Internet
Author: User

In Oracle, loop www.2cto.com is the simplest loop statement in plsql. This loop statement starts with loop and ends with end loop, this loop will be executed at least once, that is, the first loop is used to judge the case: Write a process, enter the user, and add 10 users to the user table cyclically, create or replace procedure chenchuang2 (name varchar2) is -- Definition: = indicates the value of v_num number: = 1; begin loop insert into users values (v_num, name ); -- determine whether to exit the loop exit where v_num: = 10; v_num: = v_num + 1; end loop; end; www.2cto.com contains loop statement --- while loop while is used in the same way as in java, first judge create or replace procedure chenchuang2 (name varchar2) is -- Definition: = indicates the value of v_num number: = 11; begin while v_num <= 20 loop insert into users values (v_num, name); -- determine whether to exit loop exit where v_num: = 10; v_num: = v_num + 1; end loop; 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.