SQLERRM not returning details of full stack after upgrade from 11g to 12c
Hi,
I have hit upon a problem where after upgrading to 12c, SQLEERM is not returning as expected from the error stack, loosing details from the initiating error when raised from a sub-block.
Please see example:
set serveroutput on
declare
build_failed EXCEPTION;
PRAGMA EXCEPTION_INIT(build_failed,-20514);
begin --parent block
begin --sub block
raise no_data_found; --exception is triggered here
exception when no_data_found then
raise build_failed; --propogte error to parent
end; --sub block
exception WHEN OTHERS THEN
dbms_output.put_line('sqlerrm is:');
dbms_output.put_line(SQLERRM);
RAISE;
end; --parent block
/
In 11g the output will be: