Created
September 1, 2014 15:13
-
-
Save ticklemynausea/914c9d2d077b9242d79c to your computer and use it in GitHub Desktop.
assert in pl/sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace procedure assert( | |
p_condition in boolean | |
) is | |
l_caller_owner varchar2(128); | |
l_caller_name varchar2(128); | |
l_caller_lineno varchar2(128); | |
l_caller_caller_t varchar2(128); | |
begin | |
if not p_condition then | |
owa_util.who_called_me( | |
owner => l_caller_owner, | |
name => l_caller_name, | |
lineno => l_caller_lineno, | |
caller_t => l_caller_caller_t | |
); | |
raise_application_error(-20999, 'ASSERT failed on '||l_caller_caller_t||' '||l_caller_owner||'.'||l_caller_name||':'||l_caller_lineno); | |
end if; | |
end assert; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment