help me please to understand this error.. May be i must do ud_mosh_dvig(x number, y number) and create type body after.
create or replace type CAR as object
(
mosh_dvig number,
obiem_dvig number,
color varchar2(20),
type_form varchar2(20),
massa number,
num_peredach number,
ud_mosh number,
member function ud_mosh_dvig return number
);
create or replace type body CAR
is
member function ud_mosh_dvig return number
as
begin
self.ud_mosh:=self.mosh_dvig/self.massa;
return self.ud_mosh;
end ud_mosh_dvig;
end;
By default, for every non-static function, implicitly declared
self
parameter is inIN
parameter mode. It means, that it simply cannot be modified. But, it should be noted that for non-static proceduresself
parameter is inIN OUT
default parameter mode.Although it is not a good practice to allow a function to return multiple values, change value
ud_mosh
property of an object and return the same value to the invoker, in this case, you can explicitly declareself
parameter of the function inIN OUT
parameter mode:But you wont be able to use that function in SQL, because of declared formal parameter of the function in
IN OUT
parameter mode - only PL/SQL