• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 638
  • Last Modified:

please explain this piece of code

CREATE OR REPLACE PROCEDURE WMC.GET_DATE_RANGE ( p_date_range IN     VARCHAR2,
                                             p_start_dt   IN OUT DATE,
                                             p_end_dt     IN OUT DATE,
                                             p_ref_dt_txt IN     VARCHAR2 := 'CYCLE_DT')
AS
  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?

0
joekeri
Asked:
joekeri
  • 2
1 Solution
 
ivanovnCommented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now