Nested cursor loops in Oracle stored procedures

Source: Internet
Author: User
Nested cursor loops   Create or replace procedure xh_number_186_diff_p is  begin    declare  &nbsp in Oracle stored procedures ;  -Query out a set    www.2cto.com       CURSOR c_number is        SELECT Numbe r186, money186          from xh_number_186_t a         where a.number186 In (select n.number186                            & nbsp    from xh_number_186_t n                        &NB Sp      minus                               select t.service_id                        &NBSP ;        from Xh_codesource t                    &NBSP ;   &nbsp       WHERE t.area_id = ' G000002 ');         R_number c_number%rowtype;  &nbsp ;  --Cycle start   www.2cto.com     begin      Open c_number;      loop  &N Bsp     Fetch c_number          into r_number;        Exit C_numbe r%notfound;        dbms_output.put_line (' 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 A . service_id in (select t.service_id                        &NB Sp  from Xh_codesource T                          WHERE t.area_id = ' G000002 ' &nbs P                        minus                         select n.number186 from xh_number_186_t N)       &NB Sp;and a.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.