cursor question
From: Jorge Torralba <torralba_at_europa.com>
Date: 2000/01/30
Message-ID: <3894A7A6.7067F1DF_at_europa.com>#1/1
CURSOR C1 IS SELECT RTRIM(rialto_id) FROM ibl_rialto_doc_log FOR UPDATE;
BEGIN
v_counter := 0;
OPEN C1;
LOOP
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
[Quoted] -- if it reaches this i want it to continue from the top with the next value in c1.
Date: 2000/01/30
Message-ID: <3894A7A6.7067F1DF_at_europa.com>#1/1
[Quoted] [Quoted] 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
[Quoted] 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; [Quoted] IF v_counter = 100 THEN COMMIT; v_counter := 0; exit; END IF;
END LOOP;
EXCEPTION
WHEN NO_DATA_FOUND THEN
[Quoted] -- 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 CET