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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Foreign Key question

Re: Foreign Key question

From: Walter T Rejuney <BlueSax_at_Unforgetable.com>
Date: Thu, 12 Oct 2000 12:24:14 -0400
Message-ID: <39E5E5AE.6852CC48@Unforgetable.com>

Sean wrote:

> I would like to create a FK between two tables that belong to different
> owners: [This resides on an Oracle 8i, one instance, 2 schemas foo and
> bar)
>
> TableA (owner and schema foo)
> ---------
> foo_id (PK)
> username (FK)
> comments
>
> TableB (owner and schema bar)
> ---------
> username (PK)
> firstName
>
> So if I do a :
> ALTER TABLE "FOO"."TABLEA" ADD( FOREIGN KEY (USERNAME)
> REFERENCES "BAR"."TABLEB"(USERNAME));
>
> I get a ORA-00942 : table or view does not exist.
>
> Is this possible to reference a Foreign Key from another owner?

You still have to have all of the appropriate grants on both tables.

What we'd really have to know is whether you are logged in as FOO, BAR, SYSTEM or some other account and whether the account you are logging into has the DBA role. All of it makes a difference. Received on Thu Oct 12 2000 - 11:24:14 CDT

Original text of this message

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