List:General Discussion« Previous MessageNext Message »
From:Victor Subervi Date:May 18 2010 5:36pm
Subject:Re: Foreign Key Problem
View as plain text  
On Tue, May 18, 2010 at 1:09 PM, Shawn Green <shawn.l.green@stripped>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:

100518 10:26:22 Error in foreign key constraint of table
seaflight/Passengers:
constraint foreign key (id) references Flights (flights_id), constraint
foreign key (id) references Customers (customer_id), name varchar(40),
weight tinyint(3)) engine=InnoDB:
Cannot resolve column name close to:
), constraint foreign key (id) references Customers (customer_id), name
varchar(40), weight tinyint(3)) engine=InnoDB

Here's my command:
create table if not exists Passengers (id int unsigned auto_increment
primary key, constraint foreign key (id) references Flights (flights_id),
constraint foreign key (id) references Customers (customer_id), name
varchar(40), weight tinyint(3)) engine=InnoDB;

I think I've got those constraints right. I'm calling the data from those
other tables, not the other way around. Please advise.
TIA,
V

Thread
Foreign Key ProblemVictor Subervi18 May
  • Re: Foreign Key ProblemJohan De Meersman18 May
    • Re: Foreign Key ProblemVictor Subervi18 May
      • Re: Foreign Key ProblemJohan De Meersman18 May
        • Re: Foreign Key ProblemShawn Green18 May
          • Re: Foreign Key ProblemVictor Subervi18 May
            • Re: Foreign Key ProblemShawn Green18 May
              • Re: Foreign Key ProblemVictor Subervi19 May
                • Re: Foreign Key ProblemShawn Green19 May
                  • Re: Foreign Key ProblemVictor Subervi19 May
                    • Re: Foreign Key ProblemShawn Green19 May
                      • Re: Foreign Key ProblemVictor Subervi20 May
                        • Re: Foreign Key ProblemVictor Subervi22 May