The AskTOM team is taking a break over the holiday season, so we're not taking questions or responding to comments, but we might still sneak in a few Office Hours sessions! Thanks for being a member of the AskTOM community.
Thanks for the question, Christian.
Asked: November 15, 2024 - 4:36 pm UTC
Last updated: November 28, 2024 - 3:05 pm UTC
Version: 19
Viewed 1000+ times
ALTER SESSION SET PLSQL_WARNINGS = 'ENABLE:ALL, ERROR:5005'; CREATE OR REPLACE FUNCTION foo RETURN NUMBER AUTHID DEFINER IS BEGIN RAISE NO_DATA_FOUND; EXCEPTION WHEN NO_DATA_FOUND THEN raise_application_error(-20001, 'some dynamic message that is handled by the caller'); -- RETURN NULL; -- Isn't this just dead code? END foo;
select banner from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 21c EE High Perf Release 21.0.0.0.0 - Production ALTER SESSION SET PLSQL_WARNINGS = 'ENABLE:ALL, ERROR:5005'; Session altered. CREATE OR REPLACE FUNCTION foo RETURN NUMBER AUTHID DEFINER IS BEGIN RAISE NO_DATA_FOUND; EXCEPTION WHEN NO_DATA_FOUND THEN raise_application_error(-20001, 'some dynamic message that is handled by the caller'); END foo; / Function created. sho err No errors.
Check out more PL/SQL tutorials on our LiveSQL tool.
PL/SQL reference manual from the Oracle documentation library