I made a function in Oracle that calculates the distance between two points (x1,y1)
and (x2,y2)
,here it is:
CREATE OR REPLACE FUNCTION afstand_cart (x1 IN number, x2 IN number, y1 IN number, y2 IN number)
RETURN number IS
BEGIN
return sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
END;
Now how do I call this function?
SELECT afstand_cart(0,0,1,1) FROM dual
Doesn't work.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.