Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: References
Mikael Hansen <mhansen_at_cs.auc.dk> skrev i artiklen
<Pine.GSO.4.21.0003081226440.8735-100000_at_luke.cs.auc.dk>...
> Hi
>
> I have a table where I have a colunm that needs to reference another
> table. How do I tell i to do so, after it is created??
>
> It must be something like this;
>
> FOREIGN KEY (DatabaseName_ID) REFERENCES DatabaseName;
>
Hi Mikael
You must use alter table. Here is an example:
ALTER TABLE AUTOKONTRAKT ADD
CONSTRAINT FK_AUTOKONTRAKT_PROFIL
FOREIGN KEY (PROFILE_RECNUM)
REFERENCES PROFILE(PROFILE_RECNUM)
ON DELETE CASCADE;
Peter Laursen
Received on Wed Mar 08 2000 - 05:47:53 CST
![]() |
![]() |