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 -> Oracle Problem from a beginner

Oracle Problem from a beginner

From: Chung Wing Tat Áéºa¹F <jliuws_at_hkstar.com>
Date: 1997/11/16
Message-ID: <64mdg6$2673@lyra.hkstar.com>#1/1

Hello every body!

  I am a beginner of Oracle in Hong Kong, I have a table which structures are listed as follows:

   ref_no varchar(8)
   date_from date
   date_to date

  I need to setup a constraint to this table to ensure that there is no overlapping date range in all rows so I want to setup following constraint just example ) :

   alter table booking

      add constraint CHECK_DOBULE_BOOKING check ( not (

( date_to < ( select date_from from booking ) ) and
( date_from > ( select date_to from booking ) ) ) )

  I was prompted that Oracle doesn't support sub-query in this case. how can I do it by table constraint? and how can I distinguish the field between the newly added one and the one already inside the table when setup a constraint?

Chung Wing Tat
wtchung_at_writeme.com

16-Nov-1997 Received on Sun Nov 16 1997 - 00:00:00 CST

Original text of this message

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