MySQL Forums
Forum List  »  Newbie

Re: Foreign Keys usage???
Posted by: it99ama
Date: August 18, 2004 08:28AM

This worked:

CREATE TABLE operation (
operationID int NOT NULL AUTO_INCREMENT,
name varchar(50) default NULL,
PRIMARY KEY (OperationID)
)TYPE=InnoDB;

CREATE TABLE agent (
agentID int NOT NULL AUTO_INCREMENT,
name varchar(50) default NULL,
operationID int NOT NULL,
PRIMARY KEY(agentID),

#changed--->INDEX (operationID),
FOREIGN KEY(operationID) REFERENCES operation(operationID)
)TYPE=InnoDB;


:-)
/Anders

Options: ReplyQuote


Subject
Written By
Posted
August 18, 2004 05:18AM
August 18, 2004 06:00AM
Re: Foreign Keys usage???
August 18, 2004 08:28AM


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.