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: Q: pl/sql function question ?

Re: Q: pl/sql function question ?

From: <tedchyn_at_yahoo.com>
Date: Mon, 06 Sep 1999 19:27:49 GMT
Message-ID: <7r14jb$43p$1@nnrp1.deja.com>


gennaro, I use invalid_number to find out which record contain alpha charater in a varchar2 field. If the field contain alpha, I want to write it out and continue with next record.

any suggestions ?
Thanks Ted
In article <37D39C9D.75586CD3_at_italdata.it>,   Gennaro Napolitano <Gennaro.Napolitano_at_italdata.it> wrote:
> Hy
>
> As you can see from the error output, the Oracle error code is
> "ORA-06502: PL/SQL: numeric or value error", whereas in your EXCEPTION
> area you are checking for the predefined EXCEPTION "INVALID_NUMBER"
> corresponding to the Oracle error code -1722.
>
> Modify your EXCEPTION code adding a new EXCEPTION handler for the
right
> error code.
>
> Hope this helps
>
> Ciao Gennaro
>
> tedchyn_at_yahoo.com wrote:
>
> > Sir, following error messages were received when I tried to execute
> > following procedure:
> > ERROR at line 1:
> > ORA-06502: PL/SQL: numeric or value error
> > ORA-06512: at "SCOTT.IS_NUMBER", line 5
> > ORA-06512: at line 10
> >
> > Qestion:
> > 1. why false is not returned by is_number function ? procedure stop
> > when first invalid_number is encoutered ?
>
> >
> > Thanks in advance Ted Chyn
> > =======
> > CREATE OR REPLACE FUNCTION is_number (str IN VARCHAR2)
> > RETURN BOOLEAN
> > IS
> > v_num NUMBER;
> > BEGIN v_num := TO_NUMBER (str);
> > RETURN TRUE;
> > EXCEPTION
> > WHEN INVALID_NUMBER
> > THEN RETURN FALSE;
> > END;
> > =============
>
>

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Mon Sep 06 1999 - 14:27:49 CDT

Original text of this message

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