Bulk Fetch....URGENT [message #38486] |
Mon, 22 April 2002 09:59 |
ranjan
Messages: 20 Registered: August 1999
|
Junior Member |
|
|
Hi... I am using the following code:
DECLARE
CURSOR C1 is
SELECT b.name,
b.value
FROM table1 a,
table2 b,
WHERE a.condition = b.condition;
test_var C1%ROWTYPE;
BEGIN
fetch C1 bulk collect into test_var;
END;
Now I am not able to compile this code and it is giving me the following error...
ERROR:
PLS-00597: expression 'TEST_VAR' in the INTO list is of wrong type
Pls suggest how can I make this happen.
Thanks Ranjan...
|
|
|
Re: Bulk Fetch....URGENT [message #38488 is a reply to message #38486] |
Mon, 22 April 2002 11:18 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
You can only bulk collect into scalar array types, not a rowtype. You also need to open and close the cursor.
declare
cursor c1 is
select b.name, b.value...
from ...
where ...;
type t_name is table of tableb.name%type index by binary_integer;
type t_value is table of tableb.value%type index by binary_integer;
v_name t_name;
v_value t_value;
begin
open c1;
fetch c1 bulk collect into v_name, v_value;
-- do something
close c1;
end;
|
|
|