SQL>
SQL> create or replace function f_get_speed(i_distance NUMBER, i_timeSec NUMBER)
2 return NUMBER
3 is
4 v_out NUMBER;
5 begin
6 v_out:= i_distance/i_timeSec;
7 return v_out;
8 end;
9 /
Function created.
SQL>
SQL> declare
2 v_speed NUMBER;
3 begin
4 v_speed:=f_get_speed(10,0);
5 end;
6 /
declare
*
ERROR at line 1:
ORA-01476: divisor is equal to zero
ORA-06512: at "JAVA2S.F_GET_SPEED", line 6
ORA-06512: at line 4
SQL>
|