PL/SQL and MS Windows Login

Hydemi

Member
I'd like to know if there is a way to use MS Windows username inside PL/SQL. For example, when I open a Test Window in PL/SQL 5 or 6 appear in the first line: "--Created on 30/03/2005 by HYDEMI" but it is just a comment. HYDEMI is the Windows Username, and I want to know if there is a way to use this login in a "INSERT" command for example.
Thanks ;)
 
You can use the following expression in an insert statement to insert the OS Username:
Code:
(select osuser from v$session where sid = userenv('sid'))
This requires select privileges on the v$session view though.
 
Back
Top