G
Gaurav
hi.
I have got two tables with me namely "resources" and "instance"
now structure of "resources" is :
------------------------------------
r_name varchar(50) primary key,
------------------------------------
the structure of "instance" is :
------------------------------------
instance_name varchar(50) primary key,
qty int(5),
no_allocated int(5),
r_name varchar(50)
--------------------------------------
now when i want to make the "r_name" of instance table as the foreign
key to the "resources table"
i use the followin command :
ALTER TABLE INSTANCE ADD FOREIGN KEY (R_NAME) REFERENCES
RESOURCES(R_NAME);
the error generated is :
" ERROR 1005 (HY000) : Can't create table
'.\brocade_lab\#sql-650-f7.frm' (errno : 150)
what should i do ?
regards
gaurav
I have got two tables with me namely "resources" and "instance"
now structure of "resources" is :
------------------------------------
r_name varchar(50) primary key,
------------------------------------
the structure of "instance" is :
------------------------------------
instance_name varchar(50) primary key,
qty int(5),
no_allocated int(5),
r_name varchar(50)
--------------------------------------
now when i want to make the "r_name" of instance table as the foreign
key to the "resources table"
i use the followin command :
ALTER TABLE INSTANCE ADD FOREIGN KEY (R_NAME) REFERENCES
RESOURCES(R_NAME);
the error generated is :
" ERROR 1005 (HY000) : Can't create table
'.\brocade_lab\#sql-650-f7.frm' (errno : 150)
what should i do ?
regards
gaurav