Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Triggers and Processes

Dorcas Charles9 hours ago

I want to be able to make a user inactive and expire a user within a table. How would i modify this trigger to expire a user and what would the process be in regards to the coding??

create or replace TRIGGER BIU_TBL_USERS
BEFORE INSERT OR UPDATE OR DELETE
ON TBL_USERS
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
BEGIN
IF INSERTING
THEN
:NEW.PK_USER_ID := TBL_USERS_SEQ.NEXTVAL;
:NEW.CREATEBY_DATE := SYSDATE;
:NEW.CREATEBY_USER := NVL (APEX_APPLICATION.G_USER, USER);
ELSIF UPDATING
THEN
:NEW.LASTMOD_DATE := SYSDATE;
:NEW.LASTMOD_USER := NVL (APEX_APPLICATION.G_USER, USER);
:NEW.CREATEBY_DATE := :OLD.CREATEBY_DATE;
ELSIF DELETING
THEN
NULL;
END IF;
END;

Comments
Post Details
Added 9 hours ago
0 comments
20 views