Xref: alice comp.databases.oracle.server:26517
Path: alice!news-feed.fnsi.net!newsfeed.direct.ca!su-news-hub1.bbnplanet.com!su-news-feed1.bbnplanet.com!news.bbnplanet.com!inet16.us.oracle.com!not-for-mail
From: tkyte@us.oracle.com (Thomas Kyte)
Newsgroups: comp.databases.oracle.server
Subject: Re: Explicit Cursor Commits
Date: Sat, 08 Aug 1998 14:17:13 GMT
Organization: Oracle Government
Lines: 53
Message-ID: <35cd5dd1.2979173@192.86.155.100>
References: <35CB86C7.EC0CE1ED@i84.net>
Reply-To: tkyte@us.oracle.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Newsreader: Forte Agent 1.5/32.451

A copy of this was sent to Doug Cowles <dcowles@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@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.
