Cursor loop - stop current iteration and continue with next iteration

Started by Dinesh Kumaraover 14 years ago2 messagesgeneral
Jump to latest
#1Dinesh Kumara
dinesh@rezgateway.com

Greetings..

Please advice me how to stop current iteration of cursor loop and
continue with next iteration .

...
contractlistquery = '....';
OPEN rec_contractlist FOR EXECUTE contractlistquery;
LOOP
FETCH rec_contractlist INTO
contract_from_date,contract_to_date,contract_inv_type,contract_regionid;
IF NOT FOUND THEN
EXIT;
END IF;

IF contract_count = 0 THEN
contract_initial_region = contract_regionid;
END IF;

IF contract_initial_region <> contract_regionid THEN
[Need to stop current iteration and continue with next iteration.]
ELSE
...
More logic s here...
...
END IF;

END LOOP;
CLOSE rec_contractlist;
...

Really appreciate if you can help me on this.
--

*Thanks and Regards,*
Dinesh Kumara,
Software Engineer,
Reservation Gateway Inc,
Email:dinesh@rezgateway.com <mailto:dinesh@rezgateway.com>
www.rezgateway.com

Attachments:

image002.pngimage/png; name=image002.pngDownload
#2David G. Johnston
david.g.johnston@gmail.com
In reply to: Dinesh Kumara (#1)
Re: Cursor loop - stop current iteration and continue with next iteration

On Dec 21, 2011, at 0:36, Dinesh Kumara <dinesh@rezgateway.com> wrote:

Greetings..

Please advice me how to stop current iteration of cursor loop and continue with next iteration .

...
contractlistquery = '....';
OPEN rec_contractlist FOR EXECUTE contractlistquery;
LOOP
FETCH rec_contractlist INTO contract_from_date,contract_to_date,contract_inv_type,contract_regionid;
IF NOT FOUND THEN
EXIT;
END IF;

IF contract_count = 0 THEN
contract_initial_region = contract_regionid;
END IF;

IF contract_initial_region <> contract_regionid THEN
[Need to stop current iteration and continue with next iteration.]
ELSE
...
More logic s here...
...
END IF;

END LOOP;
CLOSE rec_contractlist;
...

Really appreciate if you can help me on this.
--

Thanks and Regards,
Dinesh Kumara,
Software Engineer,
Reservation Gateway Inc,
Email:dinesh@rezgateway.com
www.rezgateway.com
<image002.png>

See

39.6.3.3

David J.