0

我需要帮助来获取此插入语句中包含的作业代码 DESCR。

我不断收到此错误SQL Status = 1400, SQL Error = ORA-01400: cannot insert NULL into ("SYSADM"."PS_J_ACTION_COUNTS"."JOBCODE_DESCR")

begin-SELECT Loops=1
E.BUSINESS_UNIT
E.JOBCODE 
EA.DESCR
E.EFFDT
E.EFFSEQ

  do Insert-XferOut

FROM  PS_JOB E,
PS_JOBCODE_TBL EA,
      PS_PERSON PP3
WHERE E.EMPLID    = &B.EmplID
  AND E.EMPLID    = PP3.EMPLID
  AND E.JOBCODE = EA.JOBCODE
  AND E.PER_ORG = 'EMP'
  AND E.EMPL_RCD = &B.EMPL_RCD
  AND (E.EFFDT < &B.EffDt OR E.EFFDT = &B.EffDt AND E.EFFSEQ < &B.EffSeq)
ORDER BY E.EFFDT DESC, E.EFFSEQ DESC

end-SELECT
end-procedure

begin-procedure Insert-XferOut


let $sql-statement = 'MP2_JOB.SQR,Insert-XferOut,Insert,PS_J_ACTION_COUNTS'

display 'Insert-XferOut-&E.BUSINESS_UNIT: ' noline
display &E.BUSINESS_UNIT

begin-SQL On-Error=SQL-Error

INSERT INTO PS_J_ACTION_COUNTS(JOBCODE,JOBCODE_DESCR,BUSINESS_UNIT,BEGINS,HIRES,RETIRES,XFERSIN,XFERSOUT,TERMINATIONS,ENDS) VALUES(&E.JOBCODE,&EA.DESCR,&E.BUSINESS_UNIT,0,0,0,0,1,0,0)

end-SQL
4

1 回答 1

1

执行查询的第一部分并检查 EA.DESCR 是否为空。

我认为EA.DESCR正在返回您尝试在JOBCODE_DESCR列中插入的空值。在这种情况下,您需要有一个 null 以外的值,或者您需要在 JOBCODE_DESCR 列中允许 null。

于 2021-03-20T03:46:56.627 回答