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: SKurosky <skurosky_at_aol.com>
Date: 08 Mar 2000 18:41:26 GMT
Message-ID: <20000308134126.23371.00000188@ng-dh1.aol.com>


>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

Original text of this message

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