我正在尝试更改对象关系模型中的类型以向其添加成员函数,但它一直给我错误

I am trying to alter a type in object relational model to add a member function to it, but it keeps giving me errors

这个 Emp_t 类型是我要更改的类型

create type Emp_t as object(
eno number(4),
ename varchar2(15),
slary number(8,2),
dependents Dependtb_t,
edept ref Dept_t
);
/

这是更改 Emp_t 类型的 DDL 命令

alter type Emp_t
add member function calChildAllowance(eno number(4)) return float
cascade;

但是它给了我这个错误:

ERROR at line 1:
ORA-06545: PL/SQL: compilation error - compilation aborted
ORA-06550: line 12, column 49:
PLS-00103: Encountered the symbol "(" when expecting one of the following:
:= . ) , @ % default character
The symbol ":=" was substituted for "(" to continue.
ORA-06550: line 0, column 0:
PLS-00565: EMP_T must be completed as a potential REF target (object type)

我想更改 Emp_t 类型以添加​​成员函数。

您似乎不需要数字数据类型的精度:

alter type Emp_t
add member function calChildAllowance(eno number) return float
cascade;