From oracle-l-bounce@freelists.org Fri Mar 19 20:13:00 2004 Return-Path: Received: from air189.startdedicated.com (root@localhost) by orafaq.com (8.11.6/8.11.6) with ESMTP id i2K2D0U01193 for ; Fri, 19 Mar 2004 20:13:00 -0600 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air189.startdedicated.com (8.11.6/8.11.6) with ESMTP id i2K2D0o01188 for ; Fri, 19 Mar 2004 20:13:00 -0600 Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 502AE390849; Fri, 19 Mar 2004 21:11:13 -0500 (EST) Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 19 Mar 2004 21:10:10 -0500 (EST) X-Original-To: oracle-l@freelists.org Delivered-To: oracle-l@freelists.org Received: from hub-slc.firsthealth.com (hub-slc.firsthealth.com [209.180.88.35]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 16605390813 for ; Fri, 19 Mar 2004 21:10:10 -0500 (EST) Received: from 10.1.114.34 by hub-slc.firsthealth.com with ESMTP ( Firsthealth.com (MMS v5.5.3)); Fri, 19 Mar 2004 19:15:09 -0600 Received: from SLCDOM-MTA by SLCM02.firsthealth.com with Novell_GroupWise; Fri, 19 Mar 2004 19:16:16 -0700 Message-ID: X-Mailer: Novell GroupWise Internet Agent 6.5.0 Date: Fri, 19 Mar 2004 19:16:02 -0700 From: "Stephen Andert" To: oracle-l@freelists.org Subject: PL SQL cursor help MIME-Version: 1.0 X-WSS-ID: 6C4576A71246925-01-01 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 1327 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: StephenAndert@firsthealth.com Precedence: normal Reply-To: oracle-l@freelists.org X-list: oracle-l I've been RTFM's and Googling and I've gotten this far, but now I'm tired and want to go home so I hope someone has fresh eyes to assist. I'm testing for a table update that will update 27 million rows of a 150 million row table (sma) with a value from a second table (mr15421). My goal is to run one command and update 27 million rows 10,000 or so at a time. This code works, but when I take out the comments in front of the commit, I get an error: declare * ERROR at line 1: ORA-01002: fetch out of sequence ORA-06512: at line 12 It is probably something basic that I'm overlooking. I hope one of you will see it and point it out to me. Thanks Stephen declare i number := 0; cursor s1 is SELECT * FROM sma a WHERE exists (select 1 from mr15421 b where a.sched_id = b.sched_id and a.proc_cd = b.proc_cd and a.proc_catg_cd = b.proc_catg_cd and a.compnnt_typ_cd = b.compnnt_typ_cd and a.eff_dt = b.eff_dt) FOR UPDATE; begin for c1 in s1 loop dbms_output.put_line (i); i := i +1; if i > 2 then dbms_output.put_line (i); -- commit; i := 0; end if; end loop; -- commit; end; / ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request@freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------