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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Scope of varialbe APP_USER

hayatms4 days ago

Hi,

Normally we use trigger for audit column on the table to assign on the server side and it works fine when you save or update any data using Oracle APEX forms. Problem is when we try to insert or update from any scheduled/Automation procedure or package so what is the best way in such case to assign a default user or any other way.

create or replace TRIGGER "XX_TABLE_BIU"
BEFORE INSERT OR UPDATE
ON JS_CRM_CHATS
FOR EACH ROW
BEGIN
IF INSERTING THEN
:NEW.CREATION_DATE := SYSDATE;
:NEW.CREATED_BY := NVL(SYS_CONTEXT('APEX$SESSION','APP_USER'),USER);
END IF;
:NEW.LAST_UPDATION_DATE := SYSDATE;
:NEW.LAST_UPDATED_BY := NVL(SYS_CONTEXT('APEX$SESSION','APP_USER'),USER);
END;
/

Thanks

Comments

Post Details

Added 4 days ago
3 comments
65 views