应用程序引擎程序-发生NULL插入错误

时间:2018-10-15 15:10:39

标签: peoplesoft peoplesoft-app-engine peoplecode

我有一个下面的Application Engine程序,正在稍作修改,但现在出现NULL插入错误(无法将值NULL插入表'XXX.dbo.PS_ITM_VNDR_UOM_PR'的列'EFFDT'中。在{{1 }}块中有一个While语句:

SQLExec

需要修改程序,以允许在尚未存在UOM(UNIT_OF_MEASURE)的地方插入新记录,因此我删除对UNIT_OF_MEASURE的引用如下,以便该程序评估为Else条件:

SQLExec("SELECT A.VENDOR_ID FROM PS_ITM_VENDOR A, PS_ITM_VNDR_UOM B WHERE A.SETID = B.SETID AND A.INV_ITEM_ID = B.INV_ITEM_ID AND A.VENDOR_SETID = B.VENDOR_SETID AND A.VENDOR_ID = B.VENDOR_ID AND A.VENDOR_ID = :1 AND A.INV_ITEM_ID = :2 AND A.ITM_ID_VNDR = :3 AND A.ITM_VNDR_PRIORITY = 1 AND B.UNIT_OF_MEASURE = :4 AND B.CONVERSION_RATE = :5", &VendorId, &InvItemId, &ItmIdVndr, &UOM, &ConvRate, &VendorId_check);

但是,当我从上述代码块中删除UNIT_OF_MEASURE SQL和Variable时,我在表ITM_VNDR_UOM_PR的EFFDT列上收到NULL插入错误。似乎在&SQL CreateSQL中定义的&UOM变量没有继承到Insert SQL代码中。为什么会发生这种情况?在插入新行时,我该怎么做才能纠正并仍然能够使用&UOM的原始实例/值?下面是整个程序步骤:

SQLExec("SELECT A.VENDOR_ID FROM PS_ITM_VENDOR A, PS_ITM_VNDR_UOM B WHERE A.SETID = B.SETID AND A.INV_ITEM_ID = B.INV_ITEM_ID AND A.VENDOR_SETID = B.VENDOR_SETID AND A.VENDOR_ID = B.VENDOR_ID AND A.VENDOR_ID = :1 AND A.INV_ITEM_ID = :2 AND A.ITM_ID_VNDR = :3 AND A.ITM_VNDR_PRIORITY = 1   AND B.CONVERSION_RATE = :4", &VendorId, &InvItemId, &ItmIdVndr, &ConvRate, &VendorId_check);

0 个答案:

没有答案