For some reason when using the raise_application_error() function in my code, I can never remember the valid numeric values. The answer is a simple mnemonic that’s in the title of this blog post.
The valid range for an error is -20000 to -20999 inclusive, which…hey! The maximum value is just one less than the error message you’ve got. So! Remember:
Valid Range: ORA-20000 through ORA-20999.
ORA-21000 means “you’ve gone too far.”
Hope this helps!
Free Oracle SQL Tuning Guide
Checkout my FREE guide, 7 SQL Tuning Secrets You Can Use Immediately, Even If You’ve Never Tuned a Query In Your Life!
Get it here: tuningsql.com/secrets