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

Home -> Community -> Usenet -> c.d.o.tools -> Cursor Question

Cursor Question

From: Jorge Torralba <torralba_at_europa.com>
Date: 2000/01/30
Message-ID: <3894A768.5355B3CB@europa.com>#1/1

In the following cursor, if the exception is encountered, the sql termnates. How can I do a continue loop in order for the process to continue with the next value ?

Thanks,

JT

DECLARE

   v_rialto_id varchar2(12);
   v_newval number;
   v_counter number;

   CURSOR C1 IS SELECT RTRIM(rialto_id) FROM ibl_rialto_doc_log FOR UPDATE;
BEGIN
   v_counter := 0;
   OPEN C1;
   LOOP
      v_counter := v_counter + 1;
      FETCH C1 INTO v_rialto_id;
         SELECT newval INTO v_newval FROM rialto_val
            WHERE RTRIM(oldval) = RTRIM(v_rialto_id);
      UPDATE ibl_rialto_doc_log
         SET rialto_id = TO_CHAR(v_newval)
         WHERE CURRENT OF C1;
      IF v_counter = 100 THEN
         COMMIT;
         v_counter := 0;
         exit;
      END IF;

   END LOOP;
EXCEPTION
   WHEN NO_DATA_FOUND THEN
-- if it reaches this i want it to continue from the top with the next value in c1.

      NULL;
END;
/

--
Jorge Torralba
SMG Applications Group

Intel
5200 N.E Elam Young parkway
JF1-18
Hillsboro OR, 97124
(503) 712-1731
Jorge.Torralba_at_Intel.com
----------------------------------------------------------------
Any views or opinions expressed by me do not reflect those
of Intel Corp.
Received on Sun Jan 30 2000 - 00:00:00 CST

Original text of this message

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