Error Creating Foreign Key In Check Data Types
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have error creating foreign key check data types phpmyadmin Meta Discuss the workings and policies of this site About Us error creating foreign key on name (check data types) Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with
#1452 - Cannot Add Or Update A Child Row: A Foreign Key Constraint Fails
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MySQL Error creating foreign key on
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million http://stackoverflow.com/questions/21711232/mysql-error-creating-foreign-key-on-columname-check-data-types programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error creating foreign key on
MySQL Error creating foreign key on gender (check data types) The SitePoint Forums have moved. You can now find them here. This forum is now closed to new posts, but you can browse existing content. You http://www.sitepoint.com/forums/showthread.php?622949-Error-creating-foreign-key-on-gender-(check-data-types) can find out more information about the move and how to open a new account (if necessary) here. If you get stuck you can get support by emailing forums@sitepoint.com If this is your first visit, be sure https://codedump.io/share/4wn7UqUGul5i/1/error-creating-foreign-key-on-lttablenamegt-check-data-types to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to foreign key visit from the selection below. SitePoint Sponsor User Tag List Results 1 to 5 of 5 Thread: Error creating foreign key on gender (check data types) Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Jun 20, 2009,12:45 #1 qazwsxedc View Profile View Forum Posts SitePoint Member Join Date Jan 2008 Posts 16 Mentioned 0 Post(s) Tagged 0 Thread(s) Error creating foreign error creating foreign key on gender (check data types) Hi there, wonder if anyone has had this problem? I'm getting this error message - Error creating foreign key on gender (check data types) even though the data types of the fields I'm trying to create a constraint between are identical - int(2) unsigned. Hope someone can stop me tearing out what little hair I have left... Jun 20, 2009,13:14 #2 qazwsxedc View Profile View Forum Posts SitePoint Member Join Date Jan 2008 Posts 16 Mentioned 0 Post(s) Tagged 0 Thread(s) Never mind, recreated the tables from scratch and it's working now for some reason. Jun 20, 2009,15:37 #3 r937 View Profile View Forum Posts SQL Consultant Join Date Jul 2002 Location Toronto, Canada Posts 39,347 Mentioned 63 Post(s) Tagged 3 Thread(s) how many different values of gender are you expecting? INTEGER UNSIGNED gives you just over 4 billion, i hope that's enough ... rudy.ca | @rudydotca Buy my SitePoint book: Simply SQL "giving out my real stuffs" Jun 21, 2009,05:55 #4 qazwsxedc View Profile View Forum Posts SitePoint Member Join Date Jan 2008 Posts 16 Mentioned 0 Post(s) Tagged 0 Thread(s) Ha, yeah it just might be... would it cause any problems though? I thought that with it being int(2) it would only allow 2 digits at most? It's an adult con
Gherkin Git Go Groovy Haml Handlebars Haskell HTML HTTP Ini iOS Jade Java Javascript jQuery JSON Julia Keyman LaTeX Linux Less LOLCODE Makefile Markdown MATLAB MySQL NASM Node.js NSIS Objective-C Pascal Perl PHP PHP Extras PowerShell Python R React JSX reST (reStructuredText) Rip Ruby Rust SAS Sass (Sass) Sass (Scss) Scala Scheme Smalltalk Smarty SQL Stylus Swift Twig TypeScript Vb.net VHDL Wiki markup YAML Other Search Azer Rtyu - 5 months ago 38x SQL Question Error creating foreign key on
`idCat` int(11) NOT NULL,
`libCat` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idCat`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `Article` (
`codeArt` int(11) NOT NULL,
`desgArt` int(11) DEFAULT NULL,
`etatArt` varchar(50) DEFAULT NULL,
`qteArt` int(11) DEFAULT '1',
`qteseulmin` varchar(50) DEFAULT NULL,
`idCat` int(11) NOT NULL,
PRIMARY KEY (`codeArt`),
KEY `idCat` (`idCat`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `Article` ADD FOREIGN KEY ( `idCat` ) REFERENCES `GestionStock`.`Catégorie` (
`idCat`
) ON DELETE SET NULL ON UPDATE CASCADE ;
Devart Answer Email {} Share You declared column Article.idCat as NOT NULL, and then you are trying to create foreign key with ON DELETE SET NULL action. Change column or foreign key definition. Source (Stackoverflow) http://stackoverflow.com/questions/16713421/error-creating-foreign-key-on-tablename-check-data-types Comments Please enable JavaScript to view the comments powered by Disqus. × Email codedump link for Error creating foreign key on