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: Number to word convertion error

Re: Number to word convertion error

From: Frank van Bortel <fvanbortel_at_netscape.net>
Date: Thu, 28 Apr 2005 13:18:41 +0200
Message-ID: <d4qgj6$afs$1@news4.zwoll1.ov.home.nl>


RT wrote:
> Hi,
> I'm trying to spell out 1,721,131.31 using a plsql and got an error
> saying "ORA-01841: (full) year must be between -4713 and +9999, and not
> be 0"
>
> Is anybody ever come across this error before?

Yes - you have a 0 for a date.

> I'm using a function posted on the web as follows:
>
> CREATE OR REPLACE FUNCTION NUMBER_CONVERSION(NUM NUMBER) RETURN
> VARCHAR2
> IS
> A VARCHAR2(1000);
> B VARCHAR2(20);
> X NUMBER;
> Y NUMBER := 1;
> Z NUMBER;
> LSIGN NUMBER;
> NO NUMBER;
> BEGIN
> X:= INSTR(NUM, '.');
 that was Error #1
Is NUM a string? No it's a number!

> LSIGN := SIGN(NUM);
> NO := ABS(NUM);
> IF X = 0 THEN
> SELECT TO_CHAR(TO_DATE(NO, 'J'), 'JSP') INTO A FROM DUAL;
And #2
How large was the input param? Over 9999? Presto.

[snip]

-- 
Regards,
Frank van Bortel
Received on Thu Apr 28 2005 - 06:18:41 CDT

Original text of this message

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