SQL>
SQL> create or replace FUNCTION to_number_or_null(aiv_number in varchar2)return number is
2 begin
3 return to_number(aiv_number);
4 exception
5 when INVALID_NUMBER then
6 return NULL;
7 end to_number_or_null;
8 /
Function created.
SQL>