Home » SQL & PL/SQL » SQL & PL/SQL » Forall - need an example with multiple row (10g)
Forall - need an example with multiple row [message #423780] Mon, 28 September 2009 03:12 Go to next message
Messages: 696
Registered: January 2007
Location: Ha Noi, Viet Nam
Senior Member
Hi all!

I've one query
UPDATE ccs_hth.khachhang_temp_1 a
   SET (ten_tt, ms_thue, diachi_tt, diachi_ct, loaikh_id, donviql_id, ma_nv,
        ma_bc) =
          (SELECT NVL (b.ten_tt, a.ten_tt), NVL (b.ms_thue, a.ms_thue),
                  NVL (b.diachi_tt, a.diachi_tt),
                  NVL (b.diachi_ct, a.diachi_ct),
                  NVL (b.loaikh_id, a.loaikh_id),
                  NVL (b.donviql_id, a.donviql_id), NVL (b.ma_nv, a.ma_nv),
                  NVL (b.ma_bc, a.ma_bc)
             FROM ccs_hth.kh_update b
            WHERE b.ma_kh = a.ma_kh)
 WHERE a.ma_kh IN (SELECT ma_kh
                     FROM ccs_hth.kh_update)

And I want to use bulk-collect (forall) to re-write it into PL/SQL. But I did not rewrite because it's sub-query.
May you guide me to do it?

Thank you!
Re: Forall - need an example with multiple row [message #423783 is a reply to message #423780] Mon, 28 September 2009 04:04 Go to previous message
Michel Cadot
Messages: 65090
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why do you want to use bulk-collect and forall?

Previous Topic: pl/sql error
Next Topic: P-Code in Oracle
Goto Forum:

Current Time: Thu Jul 27 17:58:24 CDT 2017

Total time taken to generate the page: 0.10569 seconds