db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thornton <mthorn...@optrak.co.uk>
Subject Alter table add constraints
Date Thu, 16 Aug 2007 10:32:42 GMT
The syntax in the documentation 
(http://db.apache.org/derby/docs/dev/ref/rrefsqlj81859.html) implies 
that you can add more than one constraint in a single alter table 
statement, as in this example

ALTER TABLE APP.ACTIVEVEHICLES
ADD CONSTRAINT FK__ACTIVEVEH__VEHIC__7A3223E8 FOREIGN KEY (VEHICLEID) 
REFERENCES APP.BASEVEHICLES (VEHICLEID) ON DELETE CASCADE
ADD CONSTRAINT FK_ACTIVEVEHICLES_SOLUTIONS FOREIGN KEY (SOLUTIONID) 
REFERENCES APP.SOLUTIONS (SOLUTIONID) ON DELETE CASCADE

This results in this exception:

java.sql.SQLSyntaxErrorException: Syntax error: Encountered "ADD" at 
line 4, column 1.

SQL-92 only allowed one alteration per alter table statement, I don't 
have a copy of later standards.

Regards,
Mark Thornton





Mime
View raw message