首页 > 代码库 > merge into update

merge into update

如果要DML实现真正意义上的并发,在开始执行需要并发语句前,需要执行开启session并发  ALTER SESSION ENABLE PARALLEL DML;  在执行完语句后,需要执行关闭session并发  ALTER SESSION DISABLE PARALLEL DML;

使用并行,加快大量数据更新:

merge /*+parallel(test1,4)*/ into test1 using test2

on (test1.id = test2.id)

when matched then update

set test1.name = nvl2(test1.name,test2.name,test1.name);

 

merge into tpr_fwzh1 a  using tpr_zwjjx_jxcll b on (a.fwcode=b.fwcode and a.zjlx=b.zjlx) when matched then update   set a.zhye=b.dqye,a.lxye=a.lxye+b.jxlx

merge into update