Below is my code
create or REPLACE type obj2 is object(e1 varchar2(20), e2 varchar2(20));
/
create table tbl2 (col1 varchar2(20), col2 ref obj2);
insert into tbl2 values('aa',obj2('aa','aa'));
I am getting below error:
Error report -
SQL Error: ORA-00932: inconsistent datatypes: expected REF OBJ2 got OBJ2
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
Can insert be done only through PL/SQL or am I doing this in the wrong way?
A
REFerence column needs to reference an object stored in an object-derived table.Then:
Outputs:
fiddle