From: "Terry Dykstra" <dontreply_tddykstra@forestoil.ca>
Newsgroups: comp.databases.oracle.server
References: <alc2u8$1dn$1@newsreader.mailgate.org> <hine9.26978$g9.76442@newsfeeds.bigpond.com> <aldhi1$v6$1@newsreader.mailgate.org> <3d7a534e$0$8508$cc9e4d1f@news.dial.pipex.com> <algd3t$dtl$1@newsreader.mailgate.org> <3D7CCECD.53500D62@exesolutions.com>
Subject: Re: create assertion?
Lines: 52
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Message-ID: <Hn4f9.3417$oT6.515480@news2.telusplanet.net>
Date: Mon, 09 Sep 2002 16:55:03 GMT
NNTP-Posting-Host: 209.115.237.14
X-Trace: news2.telusplanet.net 1031590503 209.115.237.14 (Mon, 09 Sep 2002 10:55:03 MDT)
NNTP-Posting-Date: Mon, 09 Sep 2002 10:55:03 MDT


It's essentially a fancy check constraint.  See
http://remote.science.uva.nl/~mdr/Teaching/RDB/0102/Silberschatz/3rdEdition/
chapter6.pdf

I don't think Oracle 9.2 supports the Create Assertion command, so you'll
have to use a trigger.

--
Terry Dykstra
Canadian Forest Oil Ltd.
"Daniel Morgan" <dmorgan@exesolutions.com> wrote in message
news:3D7CCECD.53500D62@exesolutions.com...
> eugene kim wrote:
>
> > is there an equivalent of 'create assertion' in oracle?
> > or do i have to get around with triggers?
> >
> > desired assertion is like this
> > ------------
> > no team may play two games in two different places on the same day..
> > ------------
> > this is how i'm trying..
> >
> > create or replace trigger assertion_on_game
> >         before insert or update on games
> > for each row
> > begin
> >         if exists ( select home_team_id
> >                 from teams t
> >                 where t.home_team_id = :new.visitor_team_id or --
 inserted
> >  visitor team has game in home city
> >                 t.visitor_team_id = :new.home_team_id and -- inserted
 home
> > team has game in visitor city
> >                 game_date = :new.game_date) then
> >         <don't update or insert>
> >         end if;
> > end;
> > /
> >
> > thank you
>
> Any chance you could translate the word ASSERTION into Oracle. I haven't a
> clue what you are talking about and I would expect most people are
 thinking
> the same thing.
>
> Daniel Morgan
>



