Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: References
Hi again
I'm not sure that I've got it right.
I have a table HostName with a column(DatabaseName_ID) that i supposed to be a reference to another table DatabaseName.
Then I need to use the following
ALTER TABLE HostName ADD CONSTRAINT ???? FOREIGN KEY (DatabaseName_Id) REFERENCES DatabaseName;
All the other I can't see any need for???
Best regards
Mikael Hansen
"We are Microsoft. You will be assimilated. Resistance is Futile."
On 8 Mar 2000, Peter Laursen wrote:
> 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 - 06:13:30 CST
![]() |
![]() |