Jump to content


Photo

MySQL Problem - Help please!


  • This topic is locked This topic is locked
2 replies to this topic

#1 fr@nkie

fr@nkie
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 27 October 2006 - 06:38 PM

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! :)

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 27 October 2006 - 06:43 PM

It looks like MyISAM is your default. Try specifying the InnoDB engine:


CREATE TABLE Associacoes(
  ...
) ENGINE = InnoDB;

Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 shoz

shoz
  • Staff Alumni
  • Advanced Member
  • 600 posts

Posted 27 October 2006 - 08:31 PM

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 Board Guidelines as mentioned in the PM that was sent to you previously.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users