Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: References
>MIKAEL WROTE:
>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."
>
>
Hi
It is always a good idea to name your constraints otherwise Oracle will do it
for you with a cryptic SYSC###### or something like that. Also, you need the
column of the referenced table:
REFERENCES DatabaseName(column_name).
Otherwise Oracle doesn't know which column you are referring to?
HTH
Sandy
>
Received on Wed Mar 08 2000 - 12:41:26 CST
![]() |
![]() |