Catch exception in Oracle cursor loop continue execution

Source: Internet
Author: User
Tags oracle cursor

Declare
--type definition

Cursor C_eventstate
Is
Select Campaignid,phonenumber,policynumber from Mkt_eventstate a where synstate =0 and packagestate = 2 and ErrorCode = 6 ;
--Define a cursor variable v_cinfo c_emp%rowtype, which is a row of data type in the cursor c_emp
C_row C_eventstate%rowtype;
Begin
For C_row in C_eventstate loop
Begin
Dbms_output.put_line (C_row. campaignid| | ' -' | | c_row.phonenumber| | ' -' | | C_row. Policynumber);
Raise_application_error (-20001, ' value cannot be 0 ');
EXCEPTION
--Catching exceptions
When others then
Dbms_output.put_line (' Caught the wrong begin ');
Dbms_output.put_line (C_row. Policynumber);
Dbms_output.put_line (' Catch error end ');
End

End Loop;
End

Catch exception in Oracle cursor loop continue execution

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.