PL/SQL (MOSC)

MOSC Banner

PLSQL exception handle to just ignore sepcific error code

edited Feb 19, 2014 3:51AM in PL/SQL (MOSC) 5 commentsAnswered

Hi all,

The question is simple, 

If i write SQL1(none SQL2 here) with ORA-01722 raised,   then data 33 can be inserted into table "TEST" sucessfully as well as data 11.

If i write SQL2(none SQL1 here) with ORA-01438 raised,   then data 33 can NOT be insert into table TEST,and "MAJOR" procedure stops while error ORA-01438 happens.

So how to modify my exception handle to reach the goal? or any other way?

CREATE TABLE TEST   ( A NUMBER(3,0)   );

create or replace procedure major is

begin
  insert into test values (11);
  commit;

          begin

         SQL1:insert into test values ('aaa');        ---------------ORA-01722: invalid number
         SQL2:insert into test values ('1111111111111');      -------------ORA-01438: value larger than specified precision allowed for this column

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center