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: create assertion?

Re: create assertion?

From: Terry Dykstra <dontreply_tddykstra_at_forestoil.ca>
Date: Mon, 09 Sep 2002 16:55:03 GMT
Message-ID: <Hn4f9.3417$oT6.515480@news2.telusplanet.net>

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_at_exesolutions.com> wrote in message
news:3D7CCECD.53500D62_at_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
>
Received on Mon Sep 09 2002 - 11:55:03 CDT

Original text of this message

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