capture Oracle user name from Forms App [message #142424] |
Fri, 14 October 2005 09:46 |
bdrufner
Messages: 42 Registered: August 2005 Location: Home of the Mardi Gras, N...
|
Member |
|
|
Forms 9.0.4, RDBMS 9.2
In my forms app, I am using the WHEN-DATABASE-RECORD trigger at the form level to capture the date/time of either an insert or update of the current record. This appears to be working well, but I would also like to capture the Oracle username of the user who is doing the inserting/updating. Upon SAVE, I am populating these values into a table along with other form values. This will help in my auditing of changes to the master table.
I tired using username, but I am getting back a numeric value.
The trigger code is simple enough:
begin
:cots_master_db.lastmod_date := sysdate;
:cots_master_db.lastmod_user := username;
end;
I have looked around for a system variable (:SYSTEM) in forms, but no luck.
Any ideas / thoughts / suggestions are appreciated.
Thanks
Barry
|
|
|
|
|
|
Re: capture Oracle user name from Forms App [message #142469 is a reply to message #142439] |
Fri, 14 October 2005 12:06 |
bdrufner
Messages: 42 Registered: August 2005 Location: Home of the Mardi Gras, N...
|
Member |
|
|
Kiran:
I checked, but data type agreement between items turned out not to be the problem.
The updated code: (in the hopes that others may find this useful in the future)
begin
:cots_master_db.lastmod_date := sysdate;
:cots_master_db.lastmod_user
:= get_application_property(username);
end;
The GET_APPLICATION_PROPERTY built-in did the trick.
Thanks for your help. Your suggestion did help move me in the right direction.
Barry
|
|
|