Re: Adding Foreign Key Fails

2006-07-27 Thread mark addison
On Wed, 2006-07-26 at 08:58 -0400, Jesse wrote: I am trying to add a foreign key to one of my tables. When I execute the following SQL Code: ALTER TABLE `bpa`.`confinvitems` ADD CONSTRAINT `FK_confinvitems_1` FOREIGN KEY `FK_confinvitems_1` (`InvDetID`) REFERENCES `confinvdet` (`ID`) ON

Re: Adding Foreign Key Fails

2006-07-27 Thread Jesse
By that I hope you mean there is an index on confinvitems.InvDetID _and_ confinvdet.ID Yes, there is. Could be a record in confinvitems that has an InvDetID that doesn't exist in ConfInvDet. Check with something like: SELECT InvDetID FROM confinvitems WHERE InvDetID NOT IN (SELECT ID FROM

Adding Foreign Key Fails

2006-07-26 Thread Jesse
I am trying to add a foreign key to one of my tables. When I execute the following SQL Code: ALTER TABLE `bpa`.`confinvitems` ADD CONSTRAINT `FK_confinvitems_1` FOREIGN KEY `FK_confinvitems_1` (`InvDetID`) REFERENCES `confinvdet` (`ID`) ON DELETE CASCADE; I get the error: MySQL Error Number

Re: Adding Foreign Key Fails

2006-07-26 Thread Dilipkumar
Hi, Is this a InnoDB table. Thanks Regards Dilipkumar - Original Message - From: Jesse [EMAIL PROTECTED] To: MySQL List mysql@lists.mysql.com Sent: Wednesday, July 26, 2006 6:28 PM Subject: Adding Foreign Key Fails I am trying to add a foreign key to one of my tables. When I

Re: Adding Foreign Key Fails

2006-07-26 Thread Jesse
Is this a InnoDB table. Yes, sorry, I should have mentioned that. The rest of my tables are MyISAM, and I discovered that it does not support Foreign Keys. So, I converted these tables to InnoDB so that I can put the Foreign Keys in. Thanks, Jesse -- MySQL General Mailing List For list

Re: Adding Foreign Key

2004-12-01 Thread Heikki Tuuri
Ady, - Original Message - From: Ady Wicaksono [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Wednesday, December 01, 2004 6:43 AM Subject: Adding Foreign Key mysql alter table t_quiz_trivia add foreign key (client_id) references t_client (client_id) on delete set default

Re: Adding Foreign Key

2004-12-01 Thread Ady Wicaksono
: mailing.database.myodbc Sent: Wednesday, December 01, 2004 6:43 AM Subject: Adding Foreign Key mysql alter table t_quiz_trivia add foreign key (client_id) references t_client (client_id) on delete set default; ERROR 1005: Can't create table './smsserver/#sql-215d_11eff.frm' (errno: 150) sorry, InnoDB does

Adding Foreign Key

2004-11-30 Thread Ady Wicaksono
mysql alter table t_quiz_trivia add foreign key (client_id) references t_client (client_id) on delete set default; ERROR 1005: Can't create table './smsserver/#sql-215d_11eff.frm' (errno: 150) May i know what makes error ? Here is the reference table CREATE TABLE `t_client` ( `client_id`

Re: Adding Foreign Key

2004-11-30 Thread Victor Pendleton
Do you have an index on the client_id in the t_quiz table? Can you post the ddl for t_quiz? Ady Wicaksono wrote: mysql alter table t_quiz_trivia add foreign key (client_id) references t_client (client_id) on delete set default; ERROR 1005: Can't create table './smsserver/#sql-215d_11eff.frm'

Re: Adding Foreign Key

2004-11-30 Thread Ady Wicaksono
Below DDL for t_quiz_trivia CREATE TABLE `t_quiz_trivia` ( `quiz_id` int(11) NOT NULL auto_increment, `quiz_name` text NOT NULL, `quiz_keycode` varchar(255) NOT NULL default '', `quiz_pil_jwb` varchar(255) NOT NULL default '', `quiz_confirmation_msg` varchar(255) NOT NULL default '',

Re: MySQL crash on adding foreign key constraint

2004-07-09 Thread Heikki Tuuri
: 0 Warnings: 0 mysql - Original Message - From: Daniel Kasak [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Friday, July 09, 2004 7:08 AM Subject: MySQL crash on adding foreign key constraint =_1089346615-12596-119 Content-Type: text/plain; charset=ISO-8859-1