Trigger Development

Client Events

Default Value Trigger

DECLARE
    E_IRREGULAR        EXCEPTION;
    -- Replace the default exception DUP_VAL_ON_INDEX
    PRAGMA EXCEPTION_INIT(E_IRREGULAR, -1); 
BEGIN
    IF (:NEW.ID IS NOT NULL) THEN
        RAISE E_IRREGULAR;
    END IF;
    SELECT ARTICLE_PK_SN.NEXTVAL INTO :NEW.ID FROM DUAL;
    -- the following syntax is available from 11g
    -- NEW.ID := ARTICLE_PK_SN.NEXTVAL; 
END;