| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
|  |  | |||
Home -> Community -> Usenet -> c.d.o.server -> Re: create assertion?
is there an equivalent of 'create assertion' in oracle? or do i have to get around with triggers?
desired assertion is like this
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
|  |  |