Home > database >  Oracle wants to write a custom function, bosses
Oracle wants to write a custom function, bosses

Time:09-27

If want to write a to_number conversion function returns 0 after failure, don't know how to write, ask bosses give directions!

CodePudding user response:

The begin
Return to_number ();
The exception
return 0;
end;

CodePudding user response:

The create or replace the function test (parameter varchar2)
Return the number
Is
V_number number;
The begin
V_number=to_number (parameter);
Return v_number;
The exception
The when others then
return 0;
end;
/
  • Related