![]() |
MySQL syntax help
Hiya all, i keep getting a
"Token line error=7, Token line offset=1, Token in error=CONSTRAINT" error message. Using this code Code:
Create Table Orders(Code:
Create Table Store(Code:
Create Table Pizza( |
Put the comma before the CONSTRAINT keyword as it starts a new part of the CREATE TABLE query.
Also, make sure in Code:
CONSTRAINT FK_Orders_Store |
You are missing the columns storeid and itemcode in the Orders table.
You actually have to create them in order to make a foreign key on them. there is also no data type of IDENTITY in mysql. I believe that is Oracle or SQL Server that supports that type. |
hey thanks that works. I'm getting another CONSTRAINT error message though 0_o on the new codes below. I'm using webmatrix to design these by the way.
Code:
Create table Bases(- (Token line number =6, token line offset=1, token in error=constraint) Code:
Create Table Pizza( |
AGAIN, you are missing the COMMA!
You must have a COMMA after every declaration in the CREATE TABLE. By the by, this is true in MySQL, SQL Server, Access, and most other DBs. It would help if you would realize *WHERE* the declarations start and begin. Thus: Code:
Create Table Pizza(And by the by, this *IS* the MySQL forum. Your question is not about MySQL. |
| All times are GMT +1. The time now is 06:47 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.