Hi,
I am new to oracle and here in my application I have set dbms_application_info.set_client_info( 'TEST' ); in the beginning of my procedure.
Now I have created a trigger before update in which I am checking if sys_context( 'USERENV', 'CLIENT_INFO' ) = 'TEST', but I am getting null value for this. Does sys_context have any scope under which we can set and retrieve its value ?
Here is my trigger script :
CREATE OR REPLACE TRIGGER SCHEMA.TRIG_A_UPDATE
BEFORE UPDATE
ON QC_SCHEMA.A_FUNDING
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
pragma autonomous_transaction;
userenv_value varchar2(200);
BEGIN
select sys_context( 'USERENV', 'CLIENT_INFO' ) into userenv_value from dual;
if :NEW.FUND <> :OLD.FUND then
if userenv_value = 'TEST' then // this line is not working
:NEW.UPDT_DT := :OLD.UPDT_DT;
end if;
else
:NEW.UPDT_DT := sysdate;
end if;
END A_FUNDING_UPDATE;