Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with Bulk Collect

597095Sep 13 2007 — edited Sep 13 2007
Hi 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 11 2007
Added on Sep 13 2007
8 comments
460 views