Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: TO_NUMBER() question
> SELECT text text_value,TO_NUMBER(text) number_value FROM
>my_table;
>
> If my_table.text is numeric, there's no problem. However,
if
>it's not numeric, I get an ORA-01722.
>
You could write your own function. It would slow down your
select somewhat.
CREATE OR REPLACE function to_number_null (a varchar2)
return number
as
begin
return to_number(a);
exception
when others then
return null;
end;
/Peter Received on Mon Sep 24 2001 - 10:14:49 CDT