Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: PL/SQL script error

Re: PL/SQL script error

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 09 Sep 1999 19:44:31 +0800
Message-ID: <37D79D9F.725E@yahoo.com>


James Thomson wrote:
>
> Can anyone find what is giving me this error:
>
> DECLARE
> *
> ERROR at line 1:
> ORA-02049: timeout: distributed transaction waiting for lock
> ORA-06512: at line 15
>
> Here is my script, if I substitute an actual product # for the 2
> v_tdrow.prod's and make the cursor only fetch one row, it works, so I
> think something is wrong with the way I'm doing the cursor or using it.
>
> DECLARE
> v_tdrow prdinfo.qty_sold%type;
> CURSOR info IS
> select distinct prod_id as prod_id from order_in_detail;
>
> BEGIN
>
> OPEN info;
> LOOP
> FETCH info INTO v_tdrow;
> EXIT WHEN info%NOTFOUND;
>
> UPDATE prdinfo set qty_sold=(select sum(order_qty) from
> order_in_detail where prod_id=v_tdrow.prod_id) where
> prod_id=v_tdrow.prod_id;
> END LOOP;
> close info;
> COMMIT WORK;
> END;
> .
> /
>
> ---------------------------
> James Thomson
> itabl7up_at_yahoo.com
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

The object you are trying access is probably a synonym/view on an object in a remote database. If someone has a lock of some sorts on that table (in the remote database) then you will timeout... --



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Thu Sep 09 1999 - 06:44:31 CDT

Original text of this message

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