Skip to Main Content

Hide an error from the application using a servererror trigger

353089Dec 10 2010 — edited Dec 12 2010
We have an application designed for an old oracle version which issues some sql which is no more supported in todays database version.
We want to use the application unchanged with a new database server.

The application issues an
ALTER SESSION SET OPTIMIZER_GOAL = FIRST_ROWS ;
which results in ORA-01986 and the application dies.

We would like to hide the error 01986 from the application using a trigger:
create or replace
trigger catch01986
  after servererror
  on schema
  begin
    if (ora_is_servererror (1986)) then
      null; -- what to do here? we want clear the ora-01986 from the error stack
    end if;
  end catch01986;
How to handle the error, so that the alter session set ... statement is just ignored and no error code is returned to the application?

Edited by: jjaeckel on Dec 11, 2010 12:58 AM

Edited by: jjaeckel on Dec 12, 2010 2:16 AM

Edited by: jjaeckel on 13.12.2010 02:00
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Jan 8 2011
Added on Dec 10 2010
2 comments
54 views