Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

setting "keeperrorstack" as true by default in Raise_Application_Error

Mustafa KALAYCIAug 14 2019 — edited Aug 18 2019

Hi Everyone,

I don't think there is a way (because I've read the documentation and google it and also check the codes in the database) but I wanted to confirm. As you know there is an keeperrorstack parameter in Raise_Application_Error procedure and it is set to False by default:

  procedure raise_application_error(num binary_integer, msg varchar2,

      keeperrorstack boolean default FALSE);

Many developers (unfortunately) does not use that parameter at all which is FALSE by default and this is causing to loose error stack. So we can not see if there is any previous error message. I prefer to use it as true and set it explicitly like:

raise_application_error(-20000, 'some error message', true);

but not many people does that. Now a developer team complained about they can not get the original error messages and lines, just the ones that raised with raise_application_error in an exception block and I simply told them to set third parameter as true but there are so many codes and they can not change all of them immediately.

So my question is if there is a way to set this keeperrorstack parameter as true in database or session level? that way I can save some time instead of changing all raise_application_error procedures' parameter.

thanks.

Comments
Post Details
Added on Aug 14 2019
13 comments
672 views