MySQL Forums
Forum List  »  Spanish

Persistente error nº 150 de MySQL
Posted by: ton toni
Date: March 17, 2015 06:45AM

Biuenas:

Soy nuevo en el foro, envío un saludo a todos-as y espero poder colaborar.

Para empezar tengo este inconveniente:

he intentado con diferentes combinaciones el comando Sql que describo al final, pero siempre me da el famoso error 150 de que no puede crear la tabla cuando se referencian otras tablas. Todos los id referenciados son claves primarias auto_increment. Si solo hago una referencia en vez de tres entonces si se me crea la tabla:

create table compras_lin(id int auto_increment primary key, NCompra int not null default 1, Articulo int(6) not null default 1, Descipcion char(20) default '', Cantidad double(8,2) default 1.00, Precio double (9,2) default 0.00, Descuento float(4,1) default 0.0, Tipo_IVA tinyint(3) not null default 1,Neto double(9,2) default 0.00, foreign key(NCompra) references compras_cab(id), foreign key(Articulo) references articulos(id), foreign key(Tipo_IVA) references tipos_iva(id)) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8;

¿ como la puedo crear con esas tres referencias ? me harán un gran favor si me pueden orientar

Gracias
Saludos

Options: ReplyQuote


Subject
Views
Written By
Posted
Persistente error nº 150 de MySQL
2235
March 17, 2015 06:45AM


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.