Forum Moderators: open
Desc officeHrs;
+-----------+--------------+------+-----+---------+-------+
¦ Field ¦ Type ¦ Null ¦ Key ¦ Default ¦ Extra ¦
+-----------+--------------+------+-----+---------+-------+
¦ zip_code ¦ int(10) ¦ NO ¦ ¦ 0 ¦ ¦
¦ address ¦ varchar(100) ¦ NO ¦ ¦ ¦ ¦
¦ mon_on ¦ decimal(2,2) ¦ YES ¦ ¦ NULL ¦ ¦
¦ mon_off ¦ decimal(2,2) ¦ YES ¦ ¦ NULL ¦ ¦
¦ tues_on ¦ decimal(2,2) ¦ YES ¦ ¦ NULL ¦ ¦
*********************************************************************
Both tables were created with Engine = InnoDB option.
Alter table officeHrs Add Foreign Key (zip_code,address) REFERENCES locations(zip_code_loc,address);
The error I get -
ERROR 1005 (HY000): Can't create table '.\employ\#sql-838_8.frm' (errno: 150)
There is no table with sql-838_8.
Please help me. I am not able to figure out why the foreign key is not added.