hidrau
asked on
Create two table and a foreign key?
Hello Friend,
is it correct the way that I am creating my foreign key in oracle?
Create table TEST_01 (
test01_id numeric (5) primary key not null,
nome varchar(60),
datacad Tdate
)
Create table TEST_02 (
test02_id numeric(5) primary key not null,
test01_id numeric(5) not null,
value_t numeric(9,2),
CONSTRAINT fk_TEST02 FOREIGN KEY (TEST01_ID) REFERENCES TEST01(TEST01_ID)
)
Thanks
Alex
is it correct the way that I am creating my foreign key in oracle?
Create table TEST_01 (
test01_id numeric (5) primary key not null,
nome varchar(60),
datacad Tdate
)
Create table TEST_02 (
test02_id numeric(5) primary key not null,
test01_id numeric(5) not null,
value_t numeric(9,2),
CONSTRAINT fk_TEST02 FOREIGN KEY (TEST01_ID) REFERENCES TEST01(TEST01_ID)
)
Thanks
Alex
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I don't think numeric is a valid data type either.
I take that back in that Oracle will convert that to a number data type at create time, which is valid.
ASKER
thanks