无法更新Oracle,sql developer中的Staging记录

时间:2016-11-25 06:43:33

标签: oracle-sqldeveloper

下面是我写的更新给定字段的查询,但是它的抛出无法将char更新为null错误。

UPDATE PS_H_BN_MCR_STG A SET A.H_BN_INITIAL_PARTN=(SELECT NVL(D.NAME_INITIALS,' ') 
  FROM PS_DEP_BEN_NAME D 
  WHERE D.EMPLID=A.EMPLID 
  AND D.DEPENDENT_BENEF=01 
  AND D.EFFDT=( 
SELECT MAX(D1.EFFDT) 
 FROM PS_DEP_BEN_NAME D1 
WHERE D1.EMPLID=D.EMPLID 
  AND D1.DEPENDENT_BENEF=D.DEPENDENT_BENEF 
  AND D1.EFFDT<=SYSDATE)) WHERE A.MARITAL_STATUS IN (1,6,7);

1 个答案:

答案 0 :(得分:0)

以这种方式检查您的解决方案:(1)首先更改列(H_BN_INITIAL_PARTN)现在通过以下查询允许null。然后运行查询

alter table       PS_H_BN_MCR_STG 
modify (H_BN_INITIAL_PARTN NULL);

(2)