Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
| Search | Today's Posts | Mark Forums Read
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 7th, 2003, 11:13 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default current user

I want to execute a trigger each time a record is inserted/updated/deleted. I want to write some data to an audit table, including who made the change to the record. How can I retrieve the current logged on user?

Any advice appreciated,
Pieter
 
Old November 7th, 2003, 04:20 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

select USER from dual;

will retrieve the user if it is used inside of a stored procedure, package or even trigger.

select USER
into variable
from dual;

will insert USER into a variable, variable must be declared

default value may be USER or :=USER for the field.

Hope this helps.



Sal
 
Old November 12th, 2003, 06:18 AM
Authorized User
 
Join Date: Aug 2003
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the input Sal!

Pieter





Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Get the Name of the Current User? BrianWren Beginning VB 6 1 March 27th, 2007 12:28 PM
How Can I Get the Name of the Current User? BrianWren Pro VB 6 0 March 27th, 2007 11:42 AM
Access ADP - Getting Current User Name Scripts82 Access VBA 2 March 8th, 2006 09:38 PM
Showing Current User Detail qwer Access 1 November 2nd, 2005 05:16 PM
Current user type dotnetprogrammer VS.NET 2002/2003 0 February 1st, 2005 07:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.