1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--// 일반 FOR 루프 사용
 
FOR v_i IN p_km_arr.FIRST..p_km_arr.LAST LOOP
 
              update tst_lec_apply_mgr
 
                 set gaesul_inwon = to_number(p_gaesul_inwon_arr(v_i)),
 
                    use_yn = upper(p_use_yn_arr(v_i)),
 
                    ks_cd = to_number(p_kscd_arr(v_i))
 
               where yy = p_yy
 
                 and hk = p_hk
 
                 and km = p_km_arr(v_i)
 
                 and kun = to_number(p_kun_arr(v_i));
 
END LOOP;
 
--// FORALL 문으로 대량(Bulk) DML 처리방법(Bulk bind)
 
/* 문법:
 
FORALL index_row IN
 
       [ lower_bound ... upper_bound |
 
         INDICES OF indexing_collection |
 
         VALUES OF indexing_collection
 
       ]
 
       [ SAVE EXCEPTIONS ]
 
       sql_statement;
 
*/
 
FORALL v_i IN p_km_arr.FIRST..p_km_arr.LAST
 
    update skky_inwon
 
       set gaesul_inwon = to_number(p_gaesul_inwon_arr(v_i)),
 
           use_yn = upper(p_use_yn_arr(v_i)),
 
            ks_cd = to_number(p_kscd_arr(v_i))
 
     where yy = p_yy
 
       and hk = p_hk
 
       and km = p_km_arr(v_i)
 
       and kun = to_number(p_kun_arr(v_i));

+ Recent posts