Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Referencing SYS.DBA_USERS ???
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