Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieving Username Using Oracle Triggers

I am new to using triggers. What function can I use to determine who tripped my trigger?

For example:
Someone updates a row, and I want to know who updated the row.

I am using Oracle 10g.

like image 451
Chad Avatar asked Feb 25 '23 01:02

Chad


1 Answers

SELECT sys_context('USERENV', 'SESSION_USER') FROM dual;

or

SELECT sys_context('USERENV', 'SESSION_USERID') FROM dual;
like image 152
diederikh Avatar answered Mar 18 '23 14:03

diederikh