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

Home -> Community -> Usenet -> c.d.o.server -> Re: Referencing SYS.DBA_USERS ???

Re: Referencing SYS.DBA_USERS ???

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 23 Feb 1999 19:21:21 +0100
Message-ID: <36D2F1A0.3B29D460@sybrandb.demon.nl>


Hi Jeroen,

You need to resolve this by means of a trigger. There are two problems in your statement - dba_users is a view and foreign keys to a view are not possible - you shouldn't need to and can't specify the primary key column in a foreign key clause.
You need to write a before insert or update trigger on each row

Hth,

Sybrand Bakker, Oracle DBA

"news.logica.com" wrote:

> Hi,
>
> The following script
>
> create table test_user_ref (name varchar2(30),
> userid_ref number,
> constraint fk_userid
> foreign key (userid_ref)
> references SYS.DBA_USERS
> (USER_ID));
> results in:
>
> ERROR at line 5:
> ORA-02444: Cannot resolve referenced object in referential constraints
>
> Does anybody have a workaround for this problem?
>
> Thanx,
>
> Jeroen


Received on Tue Feb 23 1999 - 12:21:21 CST

Original text of this message

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