Re: How to trigger which program updated a table ?
Date: Fri, 30 Oct 2009 18:12:31 +0200
> I need to log some updates and I would like to do it using a trigger which
> inserts a line to a logtable. I need to know which application (sqlplus,
> java, toad etc) was used to make the update. I've studied sys_context but
> didn't find that information. Toad's Session Browser shows programs that are
> connected to the database, so I think it's possible. Do You know how ?
> Thanks !
You can read the information from the V$SESSION view.
from v$session u
where u.audsid = userenv('sessionid') ;
This of course requires extended permission, but there is a work-around: put this query in a package which has the permission and call it from the trigger.
HTH, Jaakko Received on Fri Oct 30 2009 - 11:12:31 CDT