Home » SQL & PL/SQL » SQL & PL/SQL » FORALL and Bulk collect
FORALL and Bulk collect [message #219319] Wed, 14 February 2007 00:34 Go to next message
Messages: 13
Registered: August 2006
Location: Bangalore
Junior Member
Is that possible to include a cursor in the FORALL statement.

For Ex:
cursor c is select * from emp;
forall i in c
insert into emp_test(empno) values (i.empno);

Is that possible to user cursor c in forall statement or we have to declare a TYPE and then use that i the forall.

Re: FORALL and Bulk collect [message #219335 is a reply to message #219319] Wed, 14 February 2007 01:06 Go to previous message
Messages: 3727
Registered: October 2005
Location: Melbourne, Australia
Senior Member
No. The idea of FORALL is to process a COLLECTION. If you use a cursor loop, you are processing RECORDs not a COLLECTION (although a purist might argue that a cursor is a type of collection; let's not go there).

See this article for an example of how to use FORALL properly.

Ross Leishman
Previous Topic: Impact of changing Varchar to Varchar2
Next Topic: Restricting an user to access only stored procedures
Goto Forum:

Current Time: Tue Mar 28 09:02:13 CDT 2017

Total time taken to generate the page: 0.08368 seconds