MySQL Forums
Forum List  »  InnoDB

Re: ERROR 1005: Can't create table (errno: 150) - Solved
Posted by: Fuuryoku Chan
Date: July 23, 2013 09:05AM

first of all I checked the status of InnoDB, and the reason of the problem was that i tried to set null the fk on delete so i changed the query in this way


create table messaInScena
(
data date,
ora time,
spazio varchar(20),
spettacolo varchar(40),
postiDisponibili smallint,
prezzoIntero decimal(5,2),
prezzoRidotto decimal(5,2),
prezzoStudenti decimal(5,2),
primary key (data, ora, spazio),
foreign key (spazio) references spazio(nome)
on update cascade on delete cascade,
foreign key (spettacolo) references spettacolo(titolo)
on update cascade on delete cascade,
constraint RA3_1 check (postiDisponibili >= 0)
) ;

and execute it. now it's work.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: ERROR 1005: Can't create table (errno: 150) - Solved
2078
July 23, 2013 09:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.