Re: cursor loops

From: Norman Dunbar <>
Date: Wed, 30 May 2012 16:54:53 +0100
Message-ID: <>

Evening Lyall,

On 30/05/12 16:12, Lyall Barbour wrote:

> Hello everyone,

> My developers at our shop have issues with learning new stuff. When i say "new", i really mean old... Implicit cursors haven't even been discovered by them yet. Anyways, what would be a good way of having a cursor, trying to find out if there's anything in it, doing one specific thing if there is, then loop and doing same thing over and over?
> Here's current code/way of doing it:

I suppose you could get them to use collections, BULK COLLECT and FORALL or a loop around the BULK COLLECTed collection from collection.first .. collection.last? Of course, if there are lots of rows returned by the cursor, you may need to think about a LIMIT clause on the BULK COLLECT.

That might/should "freak them out" a little!

I refer you to Steven Feuerstein's excellent tome PL/SQL Programming for details on anything and everything PL/SQL.


Norman Dunbar
Dunbar IT Consultants Ltd

Registered address:
Thorpe House
61 Richardshaw Lane
West Yorkshire
United Kingdom
LS28 7EL

Company Number: 05132767
Received on Wed May 30 2012 - 10:54:53 CDT

Original text of this message