I want to create a function where a caller can declare 4 parameters and PL/SQL will solve an equation that uses these parameters. My current code is:
create or replace function get_distance(
p_y1 in number,
p_x1 in number,
p_y2 in number,
p_x2 in number)
return number
as
begin
return SQRT(power(p_x2 - p_x1) + power(p_y2 - p_y1));
end;
I'm pretty sure the error is in the return-statement but this far I haven't been able to figure it out.