[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

please explain this piece of code

Posted on 2006-04-11
2
Medium Priority
?
635 Views
Last Modified: 2008-02-01
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
Comment
Question by:joekeri
  • 2
2 Comments
 
LVL 10

Expert Comment

by:ivanovn
ID: 16426838
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
 
LVL 10

Accepted Solution

by:
ivanovn earned 200 total points
ID: 16426870
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses
Course of the Month18 days, 7 hours left to enroll

830 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