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
Karma: 0
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
Karma: 0
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: problem with cursor
Next Topic: Flash back Tables
Goto Forum:

Current Time: Tue Aug 22 11:50:40 CDT 2017

Total time taken to generate the page: 0.04991 seconds