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: check constraints

Re: check constraints

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 26 Jan 2001 05:56:42 +0100
Message-ID: <t74msu6aoqqc78@beta-news.demon.nl>

The answer to this is a plain *no*: it is simply no sql syntax. Regards,
Sybrand Bakker, Oracle DBA

<samhou_at_my-deja.com> wrote in message news:94qtgo$rca$1_at_nnrp1.deja.com...
> Hi all DBA:
> Would Oracle allow one table's check constraints to refer to
> another table's column name, also would subquery be allowed in check
> constraint in any version of oracle?
> Foreign key would be the best way for the example below, but I am
> interested to know if check constraint is possible in this case!
> For example :
> create table dept(
> deptno number,
> name varchar2(100)
> );
>
> create table emp (
> empno number,
> name varchar2(100),
> deptno number constraint emp_pk_deptno
> check(exists(select * from emp where emp.deptno = dept.deptno))
> );
>
>
>
> Thanks
> Sam Hou
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Thu Jan 25 2001 - 22:56:42 CST

Original text of this message

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