Re: locking rows with DBMS_SQL

From: Javier Rojas <jrv_at_quisar.com>
Date: Mon, 06 Jul 1998 12:48:40 +0200
Message-ID: <35A0AB88.979AE5E8_at_quisar.com>


It works!!.

The problem is that I've been using a tool called TOAD (try it, it's FREE and VERY, VERY GOOD. toadsoft.com) with AUTOCOMMIT ON and when SQL_LOCK locks the row then TOAD does a commit and the row was unlocked.

Thomas, thank you very much and greetings from Spain,

Javier Rojas.

Thomas Kyte wrote:

> I ran your function in 2 different sessions, the exact call was:
>
> begin
> if sql_lock( 'select empno from emp where empno = 7369 for update nowait' )
> then
> dbms_output.put_line( 'Got It' );
> else
> dbms_output.put_line( 'Failed...' );
> end if;
> end;
> /
>
> In the first session, it printed "Got It", on the second session it printed
> "Failed". The one big difference is that I had a NOWAIT on the select (which
> causes an error)....
>
> It works -- can you explain futher (with an example) of why you think it does
> not work?
Received on Mon Jul 06 1998 - 12:48:40 CEST

Original text of this message