Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to capture Oracle Error

Re: How to capture Oracle Error

From: Robert Fazio <rfazio_at_home.com.nospam>
Date: Tue, 10 Jul 2001 04:21:11 GMT
Message-ID: <Xov27.11671$Y6.3531677@news1.rdc2.pa.home.com>

Erika,

You need to be careful with that. You have now allowed what was a required 3 parameters to now be valid to call with 1 or 2.

Needaholiday,

Procedures are usually called by code, and it is often better to use the standard Oracle Messages for compile time errors. You could still use the check that Erika supplied for the validity of the data, but don't try and mask errors that will only occur during compile time.

"Erika Grondzakova" <Erika.Grondzakova_at_cern.ch> wrote in message news:3B49D043.18FFBBD7_at_cern.ch...
> Hello,
>
> You can try this
>
> CREATE OR REPLACE PROCEDURE SP_LOAD_REVEXP_TBL
> (IN_Inv_Per CHAR DEFAULT NULL,
> IN_Prj_Id NUMBER DEFAULT NULL,
> IN_Cust_Id CHAR DEFAULT NULL)
> IS
> begin
>
> if IN_Inv_Per is null and IN_Prj_Id is null and IN_Cust_id is null
> then
> raise_application_error(-20101, 'Here follows your error text...');
> end if;
>
> end;
> /
>
> Hth,
>
> Erika
>
>
> NeedaHoliday wrote:
> >
> > Could someone tell me how to capture the following;
> >
> > I have a procedure with the following parameters;
> >
> > CREATE OR REPLACE PROCEDURE SP_LOAD_REVEXP_TBL
> > (IN_Inv_Per CHAR,
> > IN_Prj_Id NUMBER,
> > IN_Cust_Id CHAR)
> > IS
> >
> > If I execute this without parameters I get
> >
> > ERROR at line 1:
> > ORA-06550: line 1, column 7:
> > PLS-00306: wrong number or types of arguments in call to
> > 'SP_LOAD_REVEXP_TBL'
> > ORA-06550: line 1, column 7:
> > PL/SQL: Statement ignored
> >
> > What I want to do is, override the Oracle error and put my own.
> >
> > Is there a way ?
> >
> > THanks in advance
Received on Mon Jul 09 2001 - 23:21:11 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US