Problem with Bulk Collect
597095Sep 13 2007 — edited Sep 13 2007Hi All,
I was trying a few things with Bulk Collect and was stuck with the problem in a procedure I have listed below,
create or replace procedure blk_proc is
type tTable is table of emp%ROWTYPE;
t1 tTable;
begin
select ename, sal BULK COLLECT INTO t1 from
(select ename,sal,rank() over(order by sal desc)rnk from emp)
where rnk=1;
forall x in t1.First..t1.Last
insert into d_emp values t1(x) ;
end;
When I try excuting compiling the proc, I get the following error message,
Compilation errors for PROCEDURE TREP.BLK_PROC
Error: PL/SQL: ORA-00913: too many values
Line: 8
Text: select ename, sal BULK COLLECT INTO t1 from
Error: PL/SQL: SQL Statement ignored
Line: 8
Text: select ename, sal BULK COLLECT INTO t1 from
Am I missing something in the proc??Please help
Thanks.