Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > Oracle
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 7th, 2003, 10: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
Reply With Quote
  #2 (permalink)  
Old November 7th, 2003, 03: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
Reply With Quote
  #3 (permalink)  
Old November 12th, 2003, 05: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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 08:38 PM
Showing Current User Detail qwer Access 1 November 2nd, 2005 04:16 PM
Current user type dotnetprogrammer VS.NET 2002/2003 0 February 1st, 2005 06:20 AM



All times are GMT -4. The time now is 06:42 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.