Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8579501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:37:12+00:00 2026-06-11T20:37:12+00:00

Is there oracle table that stores user defined exceptions?

  • 0

Is there oracle table that stores user defined exceptions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:37:13+00:00Added an answer on June 11, 2026 at 8:37 pm

    No.

    User-defined exceptions are, like other variables, defined in PL/SQL blocks and have whatever scope the PL/SQL variable would have. So, for example

    DECLARE
      my_exception EXCEPTION;
    BEGIN
      RAISE my_exception;
    EXCEPTION 
      WHEN my_exception
      THEN
        dbms_output.put_line( 'Caught my_exception' );
    END;
    

    will create the user-defined exception my_exception but the exception will only exist for the scope of the anonymous PL/SQL block. You can define exceptions in packages so that they can be referenced by multiple PL/SQL blocks. And you can use the exception_init pragma to associate user-defined exceptions with particular error codes

    SQL> ed
    Wrote file afiedt.buf
    
      1      DECLARE
      2        my_exception EXCEPTION;
      3        pragma exception_init( my_exception, -20001 );
      4      BEGIN
      5        RAISE my_exception;
      6*     END;
    SQL> /
        DECLARE
    *
    ERROR at line 1:
    ORA-20001:
    ORA-06512: at line 5
    

    Or you can use the raise_application_error function either alone or in concert with user-defined exception variables

    SQL> ed
    Wrote file afiedt.buf
    
      1      DECLARE
      2        my_exception EXCEPTION;
      3        pragma exception_init( my_exception, -20001 );
      4      BEGIN
      5        RAISE_APPLICATION_ERROR( -20001, 'This is my error text' );
      6      EXCEPTION
      7        WHEN my_exception
      8        THEN
      9          dbms_output.put_line( 'Caught my_exception' );
     10          dbms_output.put_line( sqlerrm );
     11*     END;
    SQL> /
    Caught my_exception
    ORA-20001: This is my error text
    
    PL/SQL procedure successfully completed.
    

    There is no data dictionary table to store user-defined exceptions because there are so many (potentially conflicting) ways that your code might define those exceptions. From a good exception management standpoint, you would generally want to come up with a consistent way of defining your application-specific exceptions and sticking to that approach. Personally, I like a package that defines all my exceptions and associates them with error codes

    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace package error_pkg
      2  as
      3    invalid_name exception;
      4    pragma exception_init( invalid_name, -20001 );
      5    invalid_address exception;
      6    pragma exception_init( invalid_address, -20002 );
      7* end;
    SQL> /
    
    Package created.
    

    Assuming all my user-defined exceptions are all defined like this, I can go to the package definition for all my definitions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in Oracle that stores files as byte arrays in a
I have a table TIME_TABLE on Oracle 10.6. There is a field called Start_Date
Is there a table i can query all of Oracle Reserved Words? Example, i
Is there a default function in Oracle that allows you to pass the date
Ok this is the scenario... I have a table in Oracle that acts like
I have a column in an Oracle DB table that is of type TIMESTAMP(6)
We have a special kind of table in our DB that stores the history
I have oracle table that holds more than 30 million records, I need to
Is there some function/procedure/package that validates a username and password in Oracle (from a
I have three tables in oracle db as newitems, itemdetails, ticketitems table. Some dummy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.