[Logo]
Forums Register Login
How to user FORALL with Cursors
Hi,
I have a requirement to retrieve ID from table and below is my code. This is working perfectly. However, seems like FORALL will be a best option to use than FOR in the Procedure.



Please advise how to use FORALL in my procedure code.
FORALL... is used with BULK COLLECT in Oracle PL/SQL to fetch and process lots of records at the same time, as described in Steven Feuerstein's article here.

But I'm not sure why you would use it in your example, as it looks like you're only fetching a few (or just one?) records anyway and not doing any bulk DML with them. And if you are only fetching one record i.e. the Department Name is unique, then you don't need a FOR loop at all.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Dec 12, 2017 07:21:25.