I have the following:
create type customer as object (
id number, name varchar2(10), points number,
member procedure add_points(num_points number)
) not final;
/
create type body customer as
member procedure add_points(num_points number) is
begin
points := points + num_points;
commit;
end add_points;
end;
/
create table customer_table of customer;
/
insert into customer_table values (customer(123,'joe',10));
/
i then do this is an anonymous block:
declare
cust customer;
begin
select treat(value(c) as customer) into cust from customer_table c where id=123;
c.add_points(100);
end;
but nothing happens - the points value remains at 10.
What have i missed? If i make my member procedure an update...set...commit
and pass in the points and a given id, it works.
Thanks.