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!

many column bulk update from cursor?

User_5OAFPNov 18 2012 — edited Nov 18 2012
I have problem figuring out how to make an update of many columns using bulk update statement (if possible). I know how to make it using merge or correleated update, I just want to know how to write it using bulk capabilities in pl/sql. Here is the code for sample tables:
create table emp_tmp as select empno, job, sal, comm from emp where deptno = 30;
update emp_tmp set sal=1000, comm=200, job='CLERK';
commit;
Now I would like to update original emp table with job, sal, comm taken from emp_tmp table for some empnos. So I write:
declare
  cursor c is ( select e.empno, t.job, t.sal, t.comm
                from emp e, emp_tmp t
                where e.empno = t.empno
                and e.empno > 7700 );
begin
  -- ... here I would like to use bulk feature for update statement on emp
end;
I can't figure out the syntax for above idea using bulk statements. Could you give me some hints about it? How it should be written?

Thanks
This post has been answered by jeneesh on Nov 18 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2012
Added on Nov 18 2012
2 comments
472 views