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: ORA-06502: PL/SQL: numeric or value error: character to number

Re: ORA-06502: PL/SQL: numeric or value error: character to number

From: John van Eck <JvanEck_at_ssc.dordrecht.nl>
Date: Mon, 14 May 2001 15:07:12 +0200
Message-ID: <3AFFD880.9BC421A6@ssc.dordrecht.nl>

Try t_line := lpad(to_char(t_getal),8,'0') for your first example and for the second example consider that spaces are something different than the null value in Oracle, you might wanna check the SQL*Plus manual, because this is quite basic stuff.

John

"sh.476622 sh476622" schreef:

> The following statements works fine in Oracle 8.0.5 and fails in 8.1.7.
>
> What can be the reason ?
>
> Regards,
> Rene
>
> Example 1
> ---------
>
> declare
> t_getal number(8);
> t_line varchar2(8);
>
> begin
> t_getal := 333;
> t_line := lpad(t_getal,8,'0'); -- hier zou uit moeten komen de
> string: 00000333
>
> Sqlerrm: ORA-06502: PL/SQL: numeric or value error: character to number
> conversion error
>
> Example 2
> ---------
>
> t_line := ' ';
> t_getal := nvl(to_number(t_line),0); -- hier zou uit
> moeten komen het getal 0
>
> PL/SQL: numeric or value error: character to number conversion error
>
> ------------------------------------------------------------
> --== Sent via Deja.com ==--
> http://www.deja.com/
>
> --
> Posted from [212.189.163.122] by way of mail23.bigmailbox.com [209.132.220.203]
> via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Mon May 14 2001 - 08:07:12 CDT

Original text of this message

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