Home » SQL & PL/SQL » SQL & PL/SQL » Bulk collect in PL/SQL
Bulk collect in PL/SQL [message #38719] Wed, 08 May 2002 07:40 Go to next message
Jason Wiest
Messages: 3
Registered: May 2002
Junior Member
I'm trying to perform a bulk collect with dynamic SQL.

If I use a static cursor, I do not have any problems, but when I do dynamic, I do. The error is "Invalid cursor" on the fecth statement

Here is my code.

declare

strSQL VARCHAR2(1000);
TYPE CHAR_ARRAY IS VARRAY(10000) OF VARCHAR2(500);
EmployeeName CHAR_ARRAY := CHAR_ARRAY();

begin
strSQL := 'SELECT NAME
FROM EMPLOYEE';
OPEN crsr FOR strSQL;

FETCH crsr BULK COLLECT INTO EmployeeName;

CLOSE crsr;
Re: Bulk collect in PL/SQL [message #38724 is a reply to message #38719] Wed, 08 May 2002 10:34 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
Jason, weak ref cursors are not supported with bulk collect. See this link for a suggested workaround:

http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1380203556717
Previous Topic: What does "Rownum=1" Do in this function
Next Topic: Job???
Goto Forum:
  


Current Time: Wed Apr 24 17:47:59 CDT 2024