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 05:39:06 +0000
Message-ID: <algipi$hls$1@newsreader.mailgate.org>

nvm i got a solution..
even though i don't know if this is a correct way to do this

create or replace trigger assertion_on_game

        before insert or update on games for each row
declare

        val integer;
begin

        select g.game_id into val
                from games g
                where (g.home_team_id = :new.visitor_team_id or
                g.visitor_team_id = :new.home_team_id) and
                g.game_date = :new.game_date;
        --don't update or insert
        if val is not null then
        :new.game_id := val;            
        end if;
        exception 
                when no_data_found
                then val := null;

end;            

/ Received on Mon Sep 09 2002 - 00:39:06 CDT

Original text of this message

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