简单的触发器

 

CREATE OR REPLACE TRIGGER TRI_FOR_SITE
    BEFORE INSERT ON SITE
    FOR EACH ROW
DECLARE
BEGIN
    SELECT SEQ_SITE.NEXTVAL INTO:NEW.ID FROM DUAL;
END TRI_FOR_SITE;

CREATE OR REPLACE TRIGGER TRI_FOR_SITE1
    BEFORE INSERT ON SITE1
    FOR EACH ROW
DECLARE
BEGIN
    SELECT SEQ_SITE1.NEXTVAL INTO:NEW.ID FROM DUAL;
END TRI_FOR_SITE1;

CREATE OR REPLACE TRIGGER TRI_FOR_SITE1_ATTR
    BEFORE INSERT ON SITE1_ATTR
    FOR EACH ROW
DECLARE
BEGIN
    SELECT SEQ_SITE1_ATTR.NEXTVAL INTO:NEW.ID FROM DUAL;
END TRI_FOR_SITE1_ATTR;

CREATE OR REPLACE TRIGGER TRI_FOR_SITEPRO_ATTR
    BEFORE INSERT ON SITEPRO_ATTR
    FOR EACH ROW
DECLARE
BEGIN
    SELECT SEQ_SITEPRO_ATTR.NEXTVAL INTO:NEW.ID FROM DUAL;
END TRI_FOR_SITEPRO_ATTR;

CREATE OR REPLACE TRIGGER TRI_FOR_XJ_INF
    BEFORE INSERT ON XJ_INF
    FOR EACH ROW
DECLARE
BEGIN
    SELECT SEQ_XJ_INF.NEXTVAL INTO:NEW.ID FROM DUAL;
END TRI_FOR_XJ_INF;

posted @ 2011-11-24 14:10  Java EE  阅读(171)  评论(0编辑  收藏  举报