Home » SQL & PL/SQL » SQL & PL/SQL » Avoid Exception (Oracle 11g,Win7 32 bit)
Avoid Exception [message #620548] Mon, 04 August 2014 04:17 Go to next message
Xandot
Messages: 235
Registered: January 2014
Location: India
Senior Member
Hello,
i want to avoid the exception in begin -end block if exception is raise then the execution of code should be continue till end of the block.
for example :--

declare
l_num number:=10;
begin
L_num:=l_num/0;
dbms_output.put_line('continue');
exception when others then
dbms_output.put_line('exception');
end;


Here i want the "continue" message but the compiler terminated to the exception section.please help me out ..

DB version:-Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Thanks ,
Xandot

[Updated on: Mon, 04 August 2014 04:18]

Report message to a moderator

Re: Avoid Exception [message #620549 is a reply to message #620548] Mon, 04 August 2014 04:26 Go to previous message
Michel Cadot
Messages: 68645
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Learn to indent your code.
SQL> declare
  2    l_num number:=10;
  3    l_excp exception;
  4    pragma exception_init(l_excp, -1476);
  5  begin
  6    begin
  7      L_num:=l_num/0;
  8    exception when l_excp then dbms_output.put_line('exception');
  9    end;
 10    dbms_output.put_line('continue');
 11  end;
 12  /
exception
continue

PL/SQL procedure successfully completed.

[Updated on: Mon, 04 August 2014 04:26]

Report message to a moderator

Previous Topic: How to sort within concatenated columns
Next Topic: how to get the total records using LEVEL
Goto Forum:
  


Current Time: Wed Apr 24 17:05:11 CDT 2024