forums › forums › SQLyog › Using SQLyog › Cant make relationship
- This topic is empty.
-
AuthorPosts
-
-
September 3, 2003 at 11:31 am #8151Venerable BedeMember
I have 2 tables declared as follows (both innodb type) :
publishers
pub_id int Primary
pub_description char
titles
title_id int Primary
title_description char
pub_id int
I have added an index to the titles.pub_id but whenever I try to create a relationship between the pub_id's in the tables it fails.
I dont get any error message at all.
Can someone tell me why this is occuring ?
Thanks in Advance
-
September 3, 2003 at 1:11 pm #14848CalEvansMember
Can you post the sql used to create the tables?
=C=
-
September 3, 2003 at 1:49 pm #14849Venerable BedeMember
I have not used any sql. I have used the sqlyog front end.
This is driving me nuts.
-
September 3, 2003 at 5:50 pm #14850RiteshMember
SQLyog logs all the queries in the History window. You can cut & paste the query out here.
Also, paste the Create Table stmt. of both the tables. You can get it from the Object Tab of SQLyog.
HTH
-
September 4, 2003 at 8:41 am #14851Venerable BedeMember
Heres what I have for the 2 tables :
notice how there are multiple foreign keys referenced. This must be where I have repeatedly tried to create the relaionship, however when I open up “Manage Relationships” none show up. How can I correct this ?
CREATE TABLE `titles` (
`pub_id` int(11) default NULL, `title_id` int(11) NOT NULL auto_increment, `title_description` varchar(100) default NULL, PRIMARY KEY (`title_id`),
KEY `pub_id` (`pub_id`), FOREIGN KEY (`pub_id`) REFERENCES `publishers` (`pub_id`), FOREIGN KEY (`pub_id`) REFERENCES `publishers` (`pub_id`) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (`pub_id`) REFERENCES `publishers` (`pub_id`), FOREIGN KEY (`pub_id`) REFERENCES `publishers` (`pub_id`) TYPE=InnoDB CHARSET=latin1 ROW_FORMAT=DYNAMIC
CREATE TABLE `publishers` ( `pub_id` int(11) NOT NULL auto_increment, `pub_name` varchar(100) default NULL, PRIMARY KEY (`pub_id`) TYPE=InnoDB CHARSET=latin1 ROW_FORMAT=DYNAMIC
-
-
AuthorPosts
- You must be logged in to reply to this topic.