Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Cant make relationship

forums forums SQLyog Using SQLyog Cant make relationship

  • This topic is empty.
Viewing 4 reply threads
  • Author
    Posts
    • #8151

      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

    • #14848
      CalEvans
      Member

      Can you post the sql used to create the tables?

      =C=

    • #14849

      I have not used any sql. I have used the sqlyog front end.

      This is driving me nuts.

    • #14850
      Ritesh
      Member

      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

    • #14851

      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

Viewing 4 reply threads
  • You must be logged in to reply to this topic.