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: eugene kim <eugene1977_at_hotmail.com>
Date: Mon, 09 Sep 2002 04:02:12 +0000
Message-ID: <algd3t$dtl$1@newsreader.mailgate.org>

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 Received on Sun Sep 08 2002 - 23:02:12 CDT

Original text of this message

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