Hi folks,
I have this situation.
SQL> ed
Wrote file afiedt.buf
1* create table x (id varchar2(10))
SQL> /
Table created.
SQL> ED
Wrote file afiedt.buf
1* create table y(name varchar2(10))
SQL> /
Table created.
SQL> insert into x values ('texas');
1 row created.
SQL> commit;
Commit complete.
SQL> alter table y add constraint rahul_check check(name in (select id from x));
alter table y add constraint rahul_check check(name in (select id from x))
*
ERROR at line 1:
ORA-02251: subquery not allowed here
I heard this can ONLY be implemented using a trigger, but, is there a way to do this using a 'check constraint'?
Thank you,
Rahul.