Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: to_number from a varchar field.
this is OK for a record where NULL is filled in,
but when the record is filled with a string,an 'ORA-01722: invalid
number' exception is thrown.
Pol
Norman Dunbar wrote:
> Try :
>
> select to_char(nvl(col1,'0')) from testtable;
>
> If the column is NULL, NVL will be replaced by a character '0' which
> to_number will convert to zero.
>
> Cheers,
> Norman.
>
> -------------------------------------
> Norman Dunbar
> Database/Unix administrator
> Lynx Financial Systems Ltd.
> mailto:Norman.Dunbar_at_LFS.co.uk
> Tel: 0113 289 6265
> Fax: 0113 289 3146
> URL: http://www.Lynx-FS.com
> -------------------------------------
>
>
Received on Mon Feb 10 2003 - 06:02:55 CST