###建自动更新的触发器###
CREATE OR REPLACE TRIGGER "SPORTS"."SPORTS_LINEUP_ID_TRIGGER" BEFORE INSERT ON "SPORTS"."LINEUP" FOR EACH ROW DECLARE next_id NUMBER; BEGIN --Get the next id number from the sequence SELECT sports_lineup_id_seq.NEXTVAL INTO next_id FROM dual; --Use the sequence number as the primarykey --for there cord being inserted. :new.id:=next_id; END; |
###建保护PRIMARYKEY的触发器###
CREATE OR REPLACE TRIGGER "SPORTS"."LINEUP_ID_UPDATE_TRIGGER" BEFORE UPDATE OF "ID" ON "SPORTS"."LINEUP" FOR EACHROW BEGIN RAISE_APPLICATION_ERROR(-20000, 'sports_lineup_id_update_trigger:Update sof the ID field' ||'arenotallowed.'); END; |
###建删除的触发器###
create or replace trigger tr_bis_exc_req_del before delete on bis_exc_req referencing old as old new as new for each row begin if :old.check_status = '3' then raise_application_error (-20001,'*****!'); return; end if; end; |
###建更新的触发器###
create or replace trigger tr_bis_exc_req_upd |