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

Home -> Community -> Usenet -> c.d.o.misc -> Re: check statement and assertion

Re: check statement and assertion

From: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Wed, 26 Nov 2003 22:31:55 +0100
Message-ID: <bs6asvo2gbbodesfl1st0jhv5pk58jmub7@4ax.com>


On 26 Nov 2003 12:07:27 -0800, laststubborn_at_hotmail.com (laststubborn) wrote:

>I am trying to write a constraint in Oracle 9 with SQL statement.
>During the creation of the table I have written
>
>check(exist
>(select line_no, count(*)
>from sections
>group by line_no
>having count(*)<=4));
>
>but this is not working. Is there anyway to get it worked?
>
>Thank you

You can't use selects in check constraints. You'll need to convert this to a trigger.

--
Sybrand Bakker, Senior Oracle DBA
Received on Wed Nov 26 2003 - 15:31:55 CST

Original text of this message

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