Nested cursor loops in oracle stored procedures

Source: Internet
Author: User

Create or replace procedure statement is begin DECLARE -- query A set of www.2cto.com CURSOR c_number is select number186, money186 from xh_number_186_t A where. number186 in (select n. number186 from xh_number_186_t n minus select t. service_id from xh_codesource t where t. area_id = 'g000002'); r_number c_number % ROWTYPE; -- the loop begins with www.2cto.com begin open c_number; loop fetch c_number into r_number; exit when c_number % notfound; values ('Number = '| r_number.number186 |' = '| r_number.money186); insert into aa_t values (r_number.number186, r_number.money186); end loop; close c_number; end; delete from xh_codesource a where. service_id in (select t. service_id from xh_codesource t where t. area_id = 'g000002 'minus select n. number186 from xh_number_186_t n) and. area_id = 'g000002 '; end xh_number_186_diff_p;

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.