LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-08-2007, 03:39 PM   #1
kpachopoulos
Member
 
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Rep: Reputation: 30
sql errors


Hi,
i have the following SQL code:
Code:
CREATE  DATABASE sqoss;

USE  sqoss;


CREATE TABLE Commiter
(
	pk_cmterID INT(10) UNSIGNED not null,
	cmterName CHAR(15) not null,
	PRIMARY KEY(pk_cmterID)
);



CREATE TABLE Project
(
	pk_projID INT(10) not null,
	projName CHAR(30) not null,
	projWebsite CHAR(50),
	projContactPoint CHAR(30),
	projSrcPath CHAR(80),
	projMailPath CHAR(80),
	PRIMARY KEY(pk_projID)
);


CREATE TABLE ProjectVersion
(	
	pfk_projID INT(10) not null,
	projName CHAR(15) not null,	
	projVersion VARCHAR(10) not null
	PRIMARY KEY (pfk_projID),
	FOREIGN KEY (pfk_projID) REFERENCES Project(pk_projID) ON UPDATE CASCADE
);


CREATE TABLE Commit
(
	pk_cmitID INT(30) UNSIGNED not null,
	cmitTime TIMESTAMP not null,
	fk_cmterID INT(10) not null,
	cmitProperties CHAR(80)
	cmitComment TEXT,
	cmitCommentLines INT(10),
	fk_projID INT(10) not null,
	FOREIGN KEY (fk_cmterID) REFERENCES Commiter(pk_cmterID) ON UPDATE CASCADE,
	FOREIGN KEY (fk_projID) REFERENCES ProjectVersion(pfk_projID) ON UPDATE	CASCADE
);
and i get the following errors:
Code:
mysql> source /home/kostas/sqo-oss/db.sql
Query OK, 1 row affected (0.00 sec)

Database changed
Query OK, 0 rows affected (0.02 sec)

Query OK, 0 rows affected (0.00 sec)

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(pfk_projID),
        FOREIGN KEY (pfk_projID) REFERENCES Project(pk_projID) ON UPDATE ' at line 6
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cmitComment TEXT,
        cmitCommentLines INT(10),
        fk_projID INT(10) not null,
        FOREI' at line 7
Can somebody explain? Syntax seems to be ok
 
Old 09-08-2007, 03:49 PM   #2
kpachopoulos
Member
 
Registered: Feb 2004
Location: Athens, Greece
Distribution: Gentoo,FreeBSD, Debian
Posts: 705

Original Poster
Rep: Reputation: 30
I'm sorry. After going for some fresh air i found two commas missing!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Sql - stored procedures, views, and dynamic sql generation LXer Syndicated Linux News 0 08-17-2006 06:33 AM
SQL: old sql dump not loading into new db BrianK Linux - Software 1 07-25-2006 11:55 PM
Migrating from MS-SQL server to My-SQL emailssent Linux - Networking 2 02-07-2005 02:20 PM
Which SQL is suitable for EMbedded SQL on C? hk_michael Programming 4 01-10-2005 05:07 PM
SQL errors on Keywords at Reviews itsjustme LQ Suggestions & Feedback 3 07-16-2004 01:33 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration