declare
type a is record(a1 number, a2 varchar2(10));
type b is record(b1 number, b2 varchar2(10));
type c is record(a1 number, b2 varchar2(10),c1 number, c2 varchar2(10));
begin
null;
end;
the record c is defined like that: the fields of c are the field of a + b.
I have a real example with a lot of field. Is there a more efficient way to declare c.
Something like that ?
type c is record( a..., c...);
And more importantly I would like thatif I change the definition of a or b, the definition of c change too.
code on dbfiddle
>Solution :
%ROWTYPE only applies to tables. Just do this:
declare
type a is record(a1 number, a2 varchar2(10));
type b is record(b1 number, b2 varchar2(10));
type c is record(a2 a, b2 b);
begin
null;
end;
Yes if you change a or b, then c will change