Question about FORALL update

40 views
Skip to first unread message

gayathri Dev

unread,
Feb 2, 2011, 10:34:35 PM2/2/11
to oracle...@googlegroups.com
Hi All,
 
I am using a FORALL bulk update and FORALL bulk Insert statement.
similar to the one used in the below example from the link : http://www.oracle-developer.net/display.php?id=410
 
 
  8     SELECT emp_ot(empno, ename, sal) BULK COLLECT INTO nt_emp
  9     FROM   emp;
10 
11     /* FORALL with workaround... */
12     FORALL i IN 1 .. nt_emp.COUNT
13        UPDATE emp
14        SET    ename = TREAT(nt_emp(i) AS emp_ot).ename
15        ,      sal   = TREAT(nt_emp(i) AS emp_ot).sal * 1.1
16        WHERE  empno = TREAT(nt_emp(i) AS emp_ot).empno;

17     dbms_output.put_line( sql%rowcount);


But the select count from line 8 and 9 was different what is returned from 17th line.
 
How can I get the records those were not inserted or updated.??
 
Thanks in advance
~G
 

Luciano Pimentel

unread,
Feb 3, 2011, 11:44:30 AM2/3/11
to oracle...@googlegroups.com
I think this link can help you.




2011/2/3 gayathri Dev <gd0...@gmail.com>

--
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle...@googlegroups.com
To unsubscribe from this group, send email to
Oracle-PLSQL...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en

Reply all
Reply to author
Forward
0 new messages