Jump to content

MySQL Problem - Help please!


fr@nkie

Recommended Posts

Hi. I asked before, but I still don't understand what is wrong with SQL command.
I now that is not a permission issue.
I try the suggestion " Add 'ENGINE = InnoDB' " and it doesn't work to :(

This is the SQL command that doesn't work:

CREATE TABLE Associacoes(
id_patrimonio1 INTEGER,
id_patrimonio2 INTEGER,
observacoes VARCHAR(255),
CONSTRAINT chave_primaria_associacao
PRIMARY KEY (id_patrimonio1,id_patrimonio2),
CONSTRAINT chave_estrangeira_id_patrimonio1
FOREIGN KEY (id_patrimonio1)
REFERENCES Patrimonio (id_patrimonio)
ON UPDATE CASCADE
ON DELETE SET NULL,
CONSTRAINT chave_estrangeira_id_patrimonio2
FOREIGN KEY (id_patrimonio2)
REFERENCES Patrimonio (id_patrimonio)
ON UPDATE CASCADE
ON DELETE SET NULL
);

It works if I take the FOREIGN KEY's CONSTRAINT's out. Like this:

CREATE TABLE Associacoes(
id_patrimonio1 INTEGER,
id_patrimonio2 INTEGER,
observacoes VARCHAR(255),
CONSTRAINT chave_primaria_associacao
PRIMARY KEY (id_patrimonio1,id_patrimonio2)
);

Please help me! Thank you! :)
Link to comment
Share on other sites

fr@nkie this is the fourth topic (one already deleted) that you've created about this issue. If you'd like to continue using this forum follow the [url=http://www.phpfreaks.com/forums/index.php/topic,6264.0.html]Board Guidelines[/url] as mentioned in the PM that was sent to you previously.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.