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: TABLE LOCKS

Re: TABLE LOCKS

From: Gary England <gengland_at_hiwaay.net>
Date: 1997/09/16
Message-ID: <341F5E0F.3C01@hiwaay.net>#1/1

bhavesh-patel_at_worldnet.att.net wrote:
>
> Hi,
>
> Can someone try to help me out,This is what happend.
>
> I wrote a procedure in PL-SQL.(Oracle 7.3), in which I have a FOR UPDATE
> Cursor, which updates three fields. When I run this procedure it hanged
> and ultimately locked the table. So I am unable to run the procedure, I
> tried the same thing on other table and it works fine. But only with this
> table it happens like this.
>
> sample body of the procedure:-
>
> PROCEDURE xxx IS CURSOR my_cur IS SELECT * from table_1 WHERE col10 =
> 'X' ORDER BY col50,col70 FOR UPDATE OF col60,col70,col50; myrec
> table_1%ROWTYPE; BEGIN OPEN my_cur; LOOP FETCH my_cur INTO myrec;
> EXIT WHEN my_cur%NOTFOUND; /* Perform calculations and change the value
> of my_Rec based on the calculations performed. */ UPDATE table_1 SET
> col50 = myrec.col50, col60 = myrec.col60, col70 = myrec.col70 WHERE
> CURRENT OF my_cur; END LOOP; CLOSE my_cur; END;
>
> The No Of Cols in Table are 65. and the size of the table is 100M. and it
> has a PK defined.
>
> Thanks in advance,
>
> BHAVESH PATEL.
> bhavesh-patel_at_worldnet.att.net
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Sounds like some other task is locking one of the rows. The kernel will lock ALL OF THE ROWS in the cursor at the OPEN command. If ANY are held by another process, you will wait. Received on Tue Sep 16 1997 - 00:00:00 CDT

Original text of this message

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