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