program column is null in v$session CREATE OR REPLACE TRIGGER AWH_TOOLS_TRG
AFTER LOGON ON HRMS.SCHEMA
DECLARE
v_prog sys.v_$session.program%TYPE;
v_pro  varchar2(250);
BEGIN
SELECT upper(program) INTO v_prog
FROM sys.v_$session
WHERE  audsid = USERENV('SESSIONID')
AND  audsid != 0
AND  ROWNUM = 1;
v_pro := SUBSTR(upper(v_prog),0,INSTR(upper(v_prog),'.')-1);
IF UPPER(USERENV('TERMINAL')) NOT IN ('DESKTOP-U186KO5','WLSRV') THEN
          IF UPPER(v_prog) LIKE '%TOAD%'      OR 
             UPPER(v_prog) LIKE '%T.O.A.D%'   OR
             UPPER(v_prog) LIKE '%SQLNAV%'    OR
             UPPER(v_prog) LIKE '%PLSQLDEV%'  OR
             UPPER(v_prog) LIKE '%BUSOBJ%'    OR
             UPPER(v_prog) LIKE '%EXCEL%'     OR
             UPPER(v_prog) LIKE '%SQLPLUS%'   OR
             UPPER(v_prog) LIKE '%FRMBLD%'    OR
             UPPER(v_prog) LIKE '%RWBUILDER%' 
          THEN
          RAISE_APPLICATION_ERROR(-20983, '" '||v_pro||' "'||' not allowed... Please contact DBA...!!!');
          END IF;
END IF;
END;


program column is not showing any data during query.
How can i resolve this issue???
The value for PROGRAM is set by the client application.  I'm not sure if it is set before or after a login.

I'll have to verify - I suspect something like Tomcat can set PROGRAM to NULL.

Other Notes


SYS_CONTEXT( 'USERENV', 'CLIENT_PROGRAM_NAME' ) might be a better method.
The value usually comes from the name of the executable.


IIRC - there is a function within the drivers to set the value to something else.

A simple RENAME/mv will bypass your LOGIN TRIGGER.


Limiting login acceptance of users based on the value of PROGRAM is a futile effort.