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: cursor problem

Re: cursor problem

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 08 Oct 1998 16:33:09 GMT
Message-ID: <361fe8fc.7986353@192.86.155.100>


A copy of this was sent to "Alvin Huang" <dkualvin_at_tp.silkera.net> (if that email address didn't require changing) On 8 Oct 1998 07:56:09 GMT, you wrote:

>Hi, all
>
>there is an application below:
>
>declare
> cursor c1 is
> select id,phone_nbr,work_order_nbr,acct_nbr
> from cw_tb
> where work_order_nbr>=' ' and
> acct_id>='A00001' and acct_id<='A09000';
>r1 c1%rowtype;
>begin
> open c1;
> loop
> fetch c1 into r1
> ......
> ......(some DML)
> ......
>
>
>here come the problem..
>when I use cursor,ORACLE will lock the table in exclusive mode or share
>mode??
> ( in this exam. the table cw_tb will be locked in shared or exclusive? )
>
>P.S I tried divide this AP to three small range,and ran on three different
>clients one by one.
> i.e client1 open cursor c1 and acc_id>='A00001' and acc_id<='A03000'
>and
> client2 open cursor c1 and acc_id>='A03001' and
>acc_id<='A06000' and
> client3 open cursor c1 and acc_id>='A06001' and
>acc_id<='A09000'
> but I find that client2&client3 will wait until client1 finish
> and client3 will wait until client2 finish
> and client3 will run finally
>
>best regards
>
>Alvin 10/8/1998

Lets see the whole thing please. The cursor, as written above, will not block for anything (its a simple read cursor and with multi-versioning in Oracle it will *not* block).

the select is not blocking -- it must be that "some DML" part that is blocking.  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Thu Oct 08 1998 - 11:33:09 CDT

Original text of this message

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