please explain this piece of code

Posted on 2006-04-11
Last Modified: 2008-02-01
                                             p_start_dt   IN OUT DATE,
                                             p_end_dt     IN OUT DATE,
                                             p_ref_dt_txt IN     VARCHAR2 := 'CYCLE_DT')
  e_invalid_day    EXCEPTION;
  e_invalid_month  EXCEPTION;
  e_invalid_year   EXCEPTION;
  PRAGMA EXCEPTION_INIT(e_invalid_day, -1847);
  PRAGMA EXCEPTION_INIT(e_invalid_month, -1843);
  PRAGMA EXCEPTION_INIT(e_invalid_year, -1841);

This is my SQL, and I have 3 exception handlers (e_invalid_day, e_invalid_month, e_invalid_year).

What I would like to know is ;   What does the -1847, -1843 and -1841 values represent?
Are they sort of error codes?

Question by:joekeri
    LVL 10

    Expert Comment

    Yes they are error codes. You are associating the exception with a certain Oracle error code. So for example your e_invalid_day exception will be associated with ORA-01847 error ("day of month must be between 1 and last day of month"), your e_invalid_month is associated with ORA-01843 ("not a valid month") error, and so on.
    LVL 10

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
    This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now