db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From BeNdErR <bendertheoffender...@hotmail.com>
Subject Derby: SQL ERROR -> Encountered "CASCADE" at line xyz
Date Sat, 04 Dec 2010 03:12:31 GMT

Hello everyone, while creating a table in my sql db I encountered this error:

SQLState:42X01
Error Code:30000
Syntax error: Encountered "CASCADE" at line 1, column 187.


this is the db structure (3 tables):


CREATE TABLE users(
   username VARCHAR(20),
   password VARCHAR(20) NOT NULL,
   type VARCHAR(5) DEFAULT 'user',
   PRIMARY KEY(username)
)
CREATE TABLE post(
   id INTEGER,
   autore VARCHAR(20),
   dataMessaggio DATE,
   messaggio VARCHAR(500),
   PRIMARY KEY(id, autore, dataMessaggio),
   FOREIGN KEY(id) REFERENCES thread(idThread) ON UPDATE CASCADE,
   FOREIGN KEY(autore) REFERENCES users(username) ON UPDATE CASCADE
)
CREATE TABLE thread (
   idThread INTEGER,
   titleThread VARCHAR(30),
   autoreThread VARCHAR(20),
   dataCreazioneThread DATE,
   dataUltimaRisposta DATE,
   PRIMARY KEY(idThread, autoreThread),
   FOREIGN KEY(autoreThread) REFERENCES users(username) ON UPDATE CASCADE
)


the error is thrown on the POST table, but I can't get rid of it.
Thanks in advance

ps: In another thread I've a pending message. I've done all I could
(followed the instructions) but it is still pending... what can I do? thanks
again
-- 
View this message in context: http://old.nabble.com/Derby%3A-SQL-ERROR--%3E-Encountered-%22CASCADE%22-at-line-xyz-tp30366617p30366617.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message