Click to See Complete Forum and Search --> : v$session values after database logon triggers


sukimac
08-04-2003, 11:59 AM
I'm trying to return the module of a session in an after database trigger. This is the code I'm using

select module into module_name from

(select module from v$session where sid = ( select sid from v$mystat where rownum=1 ));

I'm using v$mystat b/c I've heard that userenv and audid sometimes are not set in certain event triggers.

When I run that code outside of the trigger it returns a value for module if my app is T.O.A.D., but, it returns NULL through the logon trigger if logged in through T.O.A.D. as the same user.

The code also works in a DML trigger as well. Is there something about system event triggers that I'm missing??

CREATE OR REPLACE TRIGGER sec_logon
AFTER LOGON ON database
DECLARE
module_name v$session.module%TYPE;
BEGIN

select module into module_name from
(select module from v$session where sid = ( select sid from v$mystat where rownum=1 ));

insert into adept.temp_session (module, program)
values (module_name, adept.sec_access.SEC_PROGNAME);

end;