Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: References

Re: References

From: Peter Laursen <ptl_at_edbgruppen.dk>
Date: 8 Mar 2000 11:47:53 GMT
Message-ID: <01bf88f3$f28f95f0$2c289a0a@apollo>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US