Subject | Re: [firebird-support] Foreign constraints |
---|---|
Author | Martijn Tonies |
Post date | 2003-06-17T12:02:09Z |
Hi Tim,
ALTER TABLE ADRES ADD CONSTRAINT FK_ADRES_LAND
FOREIGN KEY (LANDCODE) REFERENCES LAND
(LANDCODE)
ON DELETE NO ACTION
ON UPDATE CASCADE
The constraint is named "FK_ADRES_LAND"
Many tools ( like Database Workbench ) do this automatically for you.
With regards,
Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com
> OK, so I'm impressed. :-) Now, is there any way of naming foreign keyIn my previously posted example:
> constraints when you create them? It says so in the documentation, (under
> column constraints) but I can't figure it out. It makes it easier for the
> user to have some message that would reflect, say, the column name and
> table name rather than "INTEG_13" and the table name.
ALTER TABLE ADRES ADD CONSTRAINT FK_ADRES_LAND
FOREIGN KEY (LANDCODE) REFERENCES LAND
(LANDCODE)
ON DELETE NO ACTION
ON UPDATE CASCADE
The constraint is named "FK_ADRES_LAND"
Many tools ( like Database Workbench ) do this automatically for you.
With regards,
Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com