db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen" <Bernt.John...@Sun.COM>
Subject Re: Derby foreign key ON UPDATE clause problem
Date Thu, 06 Apr 2006 08:40:46 GMT
>>>>>>>>>>>> Kristian Waagan wrote (2006-04-06 10:27:13):
> Glenn Marintes wrote:
> >Hi All,
> >
> >ij> CREATE TABLE Seal ( sealId BIGINT NOT NULL, sealFilename 
> >VARCHAR(512), sealCode VARCHAR(64) NOT NULL, sealName VARCHAR(256) NOT 
> >NULL, sealGroupFK BIGINT NOT NULL, PRIMARY KEY(sealId), FOREIGN KEY 
> >(sealGroupFK) REFERENCES SealGroup (sealGroupId) ON UPDATE CASCADE );
> >ERROR 42X01: Syntax error: Encountered "CASCADE" at line 1, column 256.
> >
> >
> >What does this error mean? How do we correct it?
> >
> 
> Hi Glenn,
> 
> I'm not an expert on this, but a look in the reference manual tells me 
> that you cannot use CASCADE with ON UPDATE.
> 
> REFERENCES table-Name [ ( Simple-column-Name [ , Simple-column-Name ]* ) ]
> [ ON DELETE {NO ACTION | RESTRICT | CASCADE | SET NULL}]
>    [ ON UPDATE {NO ACTION | RESTRICT }]
> |
> [ ON UPDATE {NO ACTION | RESTRICT }] [ ON DELETE
>    {NO ACTION | RESTRICT | CASCADE | SET NULL}]
> 
> 
> As you can see, only NO ACTION or RESTRICT can be used with ON UPDATE.
> Maybe someone can elaborate on why this is so?
> Is this a piece of missing functionality in Derby?

Yes. SQL Feature "F701 Referential update actions" is only partially
implemented. See http://wiki.apache.org/db-derby/SQLvsDerbyFeatures

You could also provied some details in the "Note" field on the
wiki-page.... ;-) 

-- 
Bernt Marius Johnsen, Database Technology Group, 
Staff Engineer, Technical Lead Derby/Java DB
Sun Microsystems, Trondheim, Norway

Mime
View raw message