Long story short what I'm trying to do is to insert some data into a table and I'm having some problems understanding what is wrong. I'll let the code talk for itself. Hope you can help me out. Thanks in advance!
CREATE OR REPLACE TYPE Departament IS OBJECT (
deptno NUMBER(2),
dname CHAR(14)
);
/
CREATE OR REPLACE TYPE Employee IS OBJECT (
empno NUMBER(4),
ename CHAR(10),
dept REF Departament,
sal NUMBER(7,2)
) NOT FINAL;
/
CREATE OR REPLACE TYPE Manager UNDER Employee (
nrEmp NUMBER(2)
);
/
CREATE TABLE departament_list AS (SELECT deptno, dname FROM dept);
/
CREATE TABLE manager_list OF Manager;
/
INSERT INTO manager_list VALUES(Manager(7782, 'JOHN', Departament(20, 'TEXAS'), 6000, 2));
Well here is the problem on the last line I get the following error
ORA-00932: inconsistent datatypes: expected REF SYS.DEPARTAMENT got SYS.DEPARTAMENT.
Now don't get me wrong I have tried doing the whole select thingy with: REF(d) from departament_list d ... but I get another error saying incorrect number of arguments for default constructor.
Maybe I'm doing this the wrong way and you can help shed some light on where I'm mistaken. Thanks again!