Reputation: 753
moni EmployeeTable%rowtype;
I have a Table object moni with row type as of Employee table. But instead I also want to add few more columns to moni in addition to Employee table columns.
What is the cleanest way to do it?
Upvotes: 1
Views: 89
Reputation: 16001
One way would be to define a cursor and then use its %rowtype
:
declare
cursor c_demo is
select s.*,
cast (null as varchar2(30)) as extra_column
from EmployeeTable s;
moni c_demo%rowtype;
begin
moni.extra_column := 'Demo';
end;
Upvotes: 1