Problem solved. I tried everything that *should* have worked and didn't.
Then I just wiped the test database and started with everything *fixed* (all
engine=innodb, all keys of same type, etc.) and it all worked.
V
Hi Victor,
The actual problem is with the key field.
Flights.pilot_id is set to INT NOT NULL and you had specified Pilots.id to
INT NULL.
You have to change both the columns to NULL or else NOT NULL to avoid the
error.
Regards,
Jay
MySQL DBA
Datavail CORP
On Tue, Jun 22, 2010 at 7:45 PM,
On Tue, Jun 22, 2010 at 11:53 AM, jayabharath jbhara...@gmail.com wrote:
Hi Victor,
The actual problem is with the key field.
Flights.pilot_id is set to INT NOT NULL and you had specified Pilots.id to
INT NULL.
You have to change both the columns to NULL or else NOT NULL to avoid the
This is just for the sake of future googlers of this thread. The correct
mysql command is:
ursor.execute('create table if not exists Passengers (id int(11)
auto_increment primary key, flights_id int(11) not null, customer_id int(11)
not null, foreign key (flights_id) references Flights (id),
On Wed, May 19, 2010 at 12:02 PM, Shawn Green shawn.l.gr...@oracle.comwrote:
Victor Subervi wrote:
On Wed, May 19, 2010 at 10:59 AM, Shawn Green shawn.l.gr...@oracle.com
wrote:
Shawn Green wrote:
look again closely at your FK definitions. The pattern should be
FOREIGN KEY
On Tue, May 18, 2010 at 2:23 PM, Shawn Green shawn.l.gr...@oracle.comwrote:
Shawn Green wrote:
I may be confused but how can the ID of the Passengers table be both the ID
of the Flight they are taking and their Customer ID at the same time?
Victor Subervi wrote:
On Tue, May 18, 2010 at 2:23 PM, Shawn Green shawn.l.gr...@oracle.comwrote:
Shawn Green wrote:
I may be confused but how can the ID of the Passengers table be both the ID
of the Flight they are taking and their Customer ID at the same time?
On Wed, May 19, 2010 at 10:59 AM, Shawn Green shawn.l.gr...@oracle.comwrote:
Shawn Green wrote:
AH! that's your mistake. You think that creating the FK will also create
the column. That does not happen. You have to define the table completely
before you can associate the columns on this
Victor Subervi wrote:
On Wed, May 19, 2010 at 10:59 AM, Shawn Green shawn.l.gr...@oracle.comwrote:
Shawn Green wrote:
AH! that's your mistake. You think that creating the FK will also create
the column. That does not happen. You have to define the table completely
before you can associate the
You're not specifying an engine, and the default is MyISAM, which doesn't
support foreign keys and will likely silently ignore requests for them. Can
you confirm that you've changed the default engine to InnoDB ?
On Tue, May 18, 2010 at 3:44 PM, Victor Subervi victorsube...@gmail.comwrote:
Hi;
On Tue, May 18, 2010 at 10:06 AM, Johan De Meersman vegiv...@tuxera.bewrote:
You're not specifying an engine, and the default is MyISAM, which doesn't
support foreign keys and will likely silently ignore requests for them. Can
you confirm that you've changed the default engine to InnoDB ?
On Tue, May 18, 2010 at 6:00 PM, Victor Subervi victorsube...@gmail.comwrote:
So apparently it didn't like my foreign key. Do I need to do something with
the table I'm referencing or what?
TIA.
Well, quickfix is to convert your tables to innoDB, starting with the
lowest-level (foreign-key
Johan De Meersman wrote:
On Tue, May 18, 2010 at 6:00 PM, Victor Subervi victorsube...@gmail.comwrote:
So apparently it didn't like my foreign key. Do I need to do something with
the table I'm referencing or what?
TIA.
Well, quickfix is to convert your tables to innoDB, starting with the
On Tue, May 18, 2010 at 1:09 PM, Shawn Green shawn.l.gr...@oracle.comwrote:
Johan De Meersman wrote:
For additional details about failed FK attempts, check the error details in
the SHOW INNODB STATUS report.
I get this:
100518 10:26:22 Error in foreign key constraint of table
Victor Subervi wrote:
On Tue, May 18, 2010 at 1:09 PM, Shawn Green shawn.l.gr...@oracle.com
mailto:shawn.l.gr...@oracle.com wrote:
Johan De Meersman wrote:
For additional details about failed FK attempts, check the error
details in the SHOW INNODB STATUS report.
I get this:
Whenever you get an INNODB error, you can get more details by running a
SHOW INNODB STATUS.
A foreign key means that a value must exist in one table before it can be
used as a value in another table. That's probably why you couldn't add a
record to Table2 before you had a value in Table1. The
I think I may have discovered one of my issues, is
memberID in Table2 was primary key. Should not have
been. As far as the error messages in removing key,
I'm still unsure.
Stuart
--- Stuart Felenstein [EMAIL PROTECTED] wrote:
Two tables:
Table1 [innodb]
userID.
addtlfields.
On Wednesday 19 February 2003 10:46, [EMAIL PROTECTED] wrote:
I have problems with foreign key creation.
I have installed mysql server cersion 3.23.53 on red hat linux 7.3.
Then I have created innodb datebase to be able to use FOREIGN KEY
Constarints.
This is concerning piece of my my.cnf
On Wednesday 22 January 2003 06:03, you wrote:
Hi Victoria
Even when I used InnoDB, it doesn't support foriegh key. It allows me to
insert data into child table without being entered to parent table.
Check that your both tables are InnoDB with SHOW TABLE STATUS command.
Show me an example of
Saju,
- Original Message -
From: Victoria Reznichenko [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Tuesday, January 21, 2003 4:27 PM
Subject: re: foreign key problem
On Tuesday 21 January 2003 09:56, Saju Pappachen wrote:
In my MySQL I have 3 tables like this and I have
On Tuesday 21 January 2003 09:56, Saju Pappachen wrote:
In my MySQL I have 3 tables like this and I have a pblm. in setting the
foreign key.Pls. help
[skip]
create table employee_skill_details(EMP_ID int(10) not null references
employee_details(EMP_ID), SKILL_ID varchar(5) not null
Haisam,
- Original Message -
From: Haisam K. Ido [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Friday, January 03, 2003 2:01 AM
Subject: Re: Foreign Key problem? in MySQL 4.0.7
Heikki:
Do you mean the PRIMARY KEY order?
UNIQUE KEY keyword(id,groupname,gid
Haisam,
- Original Message -
From: Haisam K. Ido [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Wednesday, January 01, 2003 10:29 PM
Subject: Foreign Key problem? in MySQL 4.0.7
I was able to create the gid table with no problem under mysql 4.0.7
CREATE TABLE gid (
id
Heikki:
Do you mean the PRIMARY KEY order?
Heikki Tuuri wrote:
Haisam,
- Original Message -
From: Haisam K. Ido [EMAIL PROTECTED]
Newsgroups: mailing.database.mysql
Sent: Wednesday, January 01, 2003 10:29 PM
Subject: Foreign Key problem? in MySQL 4.0.7
I was able to create the gid
24 matches
Mail list logo