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: Explicit Cursor Commits

Re: Explicit Cursor Commits

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sat, 08 Aug 1998 14:17:13 GMT
Message-ID: <35cd5dd1.2979173@192.86.155.100>


A copy of this was sent to Doug Cowles <dcowles_at_i84.net> (if that email address didn't require changing) On Fri, 07 Aug 1998 22:56:19 GMT, you wrote:

>Why does a fetch out of sequence error occur when a commit is done
>inside of a fetch loop of an open cursor? (pl/sql)
>
>Dc -
>
>

Are you doing a SELECT for UPDATE? Consider:

SQL> begin

  2          for x in ( select ename from emp ) loop
  3                  commit;
  4          end loop;

  5 end;
  6 /

PL/SQL procedure successfully completed.

SQL> begin

  2          for x in ( select ename from emp for update ) loop
  3                  commit;
  4          end loop;

  5 end;
  6 /
begin
*
ERROR at line 1:
ORA-01002: fetch out of sequence
ORA-06512: at line 3

select for update cursors are always closed on commit...  

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 Sat Aug 08 1998 - 09:17:13 CDT

Original text of this message

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