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: how to lock record instead of lock tab?

Re: how to lock record instead of lock tab?

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 03 Feb 2000 08:56:09 -0500
Message-ID: <072j9s47p3867bnberve0vvcc6ole4bkn8@4ax.com>


A copy of this was sent to Johnny <jloved_at_my-deja.com> (if that email address didn't require changing) On Thu, 03 Feb 2000 07:53:57 GMT, you wrote:

>I need some helps about lock. Does anyone know how to lock record? I
>only know how to lock table (select * from table1 for update) but, it is
>too slow when there are a lot of transactions in the waiting queue.
>

to lock a record(s) just add a predicate to your query:

select * from t where pk = value FOR UPDATE;

>please help!
>
>Johnny
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Thu Feb 03 2000 - 07:56:09 CST

Original text of this message

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