Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Who is locking a record (not just a table)

Re: Who is locking a record (not just a table)

From: TimKArnold <timkarnold_at_aol.com>
Date: 06 Jan 2000 02:36:06 GMT
Message-ID: <20000105213606.02475.00000894@ng-fr1.aol.com>


Are you locking the record using SQL
or bounded controls? We lock records in VB using 'Select ..where ssno =1 for update nowait'

So we can interrogate the v$session, v$lock, v$sqltext_with_newlines tables:

I'm exploiting the fact that I have field 'ssno'  

select distinct x.sid, v.username,
substr(s.sql_Text,instr(s.sql_text,'ssno',1)+8,9) ssno from v$session v, v$lock x, v$sqltext_with_newlines s Where v.sid = x.sid

and v.sql_hash_value = s.hash_value 
and s.sql_text like '%ssno%' 
and v.username is not NULL

HTH,
Tim

>Hi,
>
>Is there any view in Oracle8 to display which user is locking what
>records? We are in the development of a VB6 application which requires
>to display userid who is currently locking the record. Such as:
>
>The reocrd is locked by USERID!
>
>V$session view can only provide object_id which doesn't go down to ROW
>level. Several users can access the same table but different rows.
>
>Any help will be appreciated!
>
>
Received on Wed Jan 05 2000 - 20:36:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US