select 'select * from '||wl.table1||' where rowid= ''' || wl.aa||''';' from
(select o.object_name table1 ,dbms_rowid.rowid_create(1,s.row_wait_obj#,s.row_wait_file#,s.row_wait_block#,s.row_wait_row#) aa
from v$session s , dba_waiters w , v$locked_object l , dba_objects o
where w.waiting_session=s.SID
and w.mode_held='Exclusive'
and w.waiting_session=l.SESSION_ID
and l.OBJECT_ID=o.object_id ) wl;