Reference to uninitialized composite
Hi All
I have a problem when executing a package demo.main bcos it access a object type. i get the error :ORA-06530: Reference to uninitialized composite.
The code is show below:
type emp_typ as object
(
a number,
b varchar2(10),
c date,
member procedure to_upper
)
type body emp_tpe is
member procedure to_upper is
begin
b := upper(b);
end;
end;
package demo
is
emp emp_typ;
procedure tst_pro (emp in emp_typ);
procedure main;
end demo;
type body emp_typ is
member procedure to_upper is
begin
a :=0;
b := upper(b);
end;
end;
package body demo
is
procedure tst_pro(emp in emp_typ)
is
begin
dbms_output.put_line ('The object varaible value is :'||emp.a||' '||emp.b||' '||emp.c);
--insert into test (emp_id) values (var1);
end tst_pro;
procedure main
is
begin
emp.a :=10;
emp.b := 'Indrajit';
emp.c :=sysdate;
tst_pro(emp);
end main;
end demo;
Can anybody help me out to get rid of this error. i dnt know what is going wrong in my code.
Thanks...................
Regds ,
Indrajit Pal
|