error 1064
| User, date | Message |
|---|---|
|
Written by speedking47
2 years ago Category: Creating a connection 5 posts since Mon, 07 Feb 11 |
When I want to create foreign key I get this message: You have an error in your SQL syntax;check the manual that corresponds to your Mysql server version for the syntax to use near ')ON UPDATE NO ACTION ON DELETE NO ACTION' AT LINE 2 What do I have to do? |
|
Written by ansgar
2 years ago 3958 posts since Fri, 07 Apr 06 |
Post the full query please. |
|
Written by speedking47
2 years ago 5 posts since Mon, 07 Feb 11 |
here is: ADD CONSTRAINT 'Fk1milos' FOREIGN KEY ('gradid') REFERENCES 'gradovi' () |
|
Written by ansgar
2 years ago 3958 posts since Fri, 07 Apr 06 |
That's not the full query ... |
|
Written by speedking47
2 years ago 5 posts since Mon, 07 Feb 11 |
Is this the right query: CREATE TABLE `korisnici` ( `maticnibroj` INT(13) NOT NULL, `ime` VARCHAR(40) NOT NULL, `prezime` VARCHAR(40) NOT NULL, `gradid` INT(10) NOT NULL, PRIMARY KEY (`maticnibroj`), CONSTRAINT `FK1_gradid` FOREIGN KEY (`gradid`) REFERENCES `gradovi` () ) and why it's possible to set foreign key with query but not automatically in the card foreign key? |
|
Written by ansgar
2 years ago 3958 posts since Fri, 07 Apr 06 |
Yes that's the query I asked for - thanks. Looks like you did not select a column in the foreign table, right? If you do so the column should appear in the now empty parentheses. |
|
Written by speedking47
2 years ago 5 posts since Mon, 07 Feb 11 |
that was the problem I see it now.. thanks |
|
Please login to leave a reply, or register at first. |