Home » Developer & Programmer » Forms » capture Oracle user name from Forms App
capture Oracle user name from Forms App [message #142424] Fri, 14 October 2005 09:46 Go to next message
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 #142435 is a reply to message #142424] Fri, 14 October 2005 10:05 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
Check that data table definition once.

--Kiran.
Re: capture Oracle user name from Forms App [message #142437 is a reply to message #142435] Fri, 14 October 2005 10:09 Go to previous messageGo to next message
bdrufner
Messages: 42
Registered: August 2005
Location: Home of the Mardi Gras, N...
Member
Kiran:

Thanks for your reply.

I am new to forms and I do not understand what you mean about the "data table definition".

Thanks for your help. It is appreciated.
Re: capture Oracle user name from Forms App [message #142439 is a reply to message #142424] Fri, 14 October 2005 10:21 Go to previous messageGo to next message
kiran
Messages: 503
Registered: July 2000
Senior Member
Sorry for not making it clear.

I just said you to check the table structure and the "user name" column name data type in the table.

and more over check the control data type too.

--Kiran
Re: capture Oracle user name from Forms App [message #142469 is a reply to message #142439] Fri, 14 October 2005 12:06 Go to previous message
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
Previous Topic: Updating values in a details block
Next Topic: radio button problem
Goto Forum:
  


Current Time: Fri Sep 20 00:43:16 CDT 2024