f***e 发帖数: 17 | 1 我要计算两点间距离,需要用到built-in function POWER and SQRT,
下面的code 该如何调用这些函数修改?
create or replace type Point as object(
X float,
Y float
);
/
create or replace type Line as object(
SP point,
EP point,
member function length return FLOAT, /* get line length */
pragma restrict_references(length,WNDS,WNPS)
);
/
create or replace type body Line as
member function length return FLOAT is
dx float; -- x direction distance square
dy float; -- y direction distance squa | n********a 发帖数: 68 | 2 create or replace type body Line as
member function length return FLOAT is
dp float; -- real distance
begin
SELECT SQRT(POWER((sp.x-ep.x),2)+POWER((sp.y-ep.y),2)) into dp FROM
DUAL;
return dp;
end;
end;
/
【在 f***e 的大作中提到】 : 我要计算两点间距离,需要用到built-in function POWER and SQRT, : 下面的code 该如何调用这些函数修改? : create or replace type Point as object( : X float, : Y float : ); : / : create or replace type Line as object( : SP point, : EP point,
|
|