I created an OBJECT type and a VARRAY:
CREATE TYPE termek_adat IS OBJECT(
termek_id number(3), termek_db number(3));
/
CREATE type TERMEK_INF is VARRAY(10000) OF termek_adat;
I created a table:
CREATE TABLE Elad(
elad_id number(3),
termek_i TERMEK_INF constraint elad_ref_term_fk references termek(termek_id),
faktura_id number(3),
datum timestamp,
constraint e_pk_key primary key(elad_id)
);
there is a VARRAY termek_i. I want to use TERMEK_ADAT objects termek_id field as foreign key to this table:
CREATE TABLE Termek
(termek_id NUMBER(3) CONSTRAINT term_term_id_pk PRIMARY KEY,
megnevezes VARCHAR2(50),
termek_kod NUMBER(15),
termek_ar NUMBER(5),
db_uzlet NUMBER(3),
db_raktar NUMBER(3),
szallito_id NUMBER(3) CONSTRAINT term_term_fk REFERENCES Szallitok(szallito_id) );
I dont know how i can realize that. Thanks for hep.