I am creating a BEFORE DELETE trigger to insert records into an archive table that are deleted through an APEX form on another table. I want to update two columns "UPDATED_BY" and "UPDATED"_DATE" based on the SYSDATE and :APP_USER (APEX Application Item). I'm getting an error related to the :APP_USER (PLS-00049: bad bind variable 'APP_USER'). Is there a specific syntax I have to use to reference APEX app items when creating the trigger?
CREATE OR REPLACE TRIGGER "ARCHIVE_DELETED_RECORDS"
BEFORE
delete on "RECORD_TABLE"
for each row
begin
INSERT INTO DELETED_RECORD_TABLE (
STAGING_ID,
SOURCE_FILE_ID,
DELETION_DATE,
DELETED_BY,
DELETED_FROM)
SELECT
STAGING_ID,
SOURCE_FILE_ID,
SYSDATE,
:APP_USER,
'Record Table 1'
FROM RECORD_TABLE
end;
/
ALTER TRIGGER "ARCHIVE_DELETED_RECORDS" ENABLE;