Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: check statement and assertion
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 DBAReceived on Wed Nov 26 2003 - 15:31:55 CST
![]() |
![]() |