I am a client server developer and have used a 'Select for Update .. NOWAIT' clause to lock an SQL allowing only one user to run a query at a time. When another user is trying to run the same SQL he/she gets a message that another user is running the SQL.

I am looking for a way to identify the user who is already running the query so the message will say 'User xxx is currently running the query'.

Using Oracle 9.2.01.