Link to home
Start Free TrialLog in
Avatar of hidrau
hidrauFlag for Brazil

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
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of hidrau

ASKER

thanks