I'm trying to use refs to link objects between tables. Something like the following.
CREATE OR REPLACE TYPE TYP_REFT AS OBJECT
(A NUMBER, B NUMBER);
/
CREATE TABLE REFTT
(
ref_id number,
my_reft typ_reft
)
/
CREATE TABLE REFTAB
(ID REF TYP_REFT);
/
INSERT INTO REFTT VALUES (typ_reft(1,2));
/
INSERT INTO REFTAB
SELECT REF(T.my_reft) FROM REFTT T
/
SELECT * FROM REFTAB;
This doesn't work though. Giving me the error
Error starting at line : 18 in command -
INSERT INTO REFTAB
SELECT REF(T.my_reft) FROM REFTT T
Error at Command Line : 19 Column : 12
Error report -
SQL Error: ORA-00904: "T"."MY_REFT": invalid identifier
00904. 00000 - "%s: invalid identifier"
It works fine if the table REFTT is made by saying
CREATE TABLE REFTT OF TYP_REFT
But since I'd like to store other information in the table besides just the object, it's a little problematic.