我在oracle d2k中尝试在密钥提交触发器中运行更新查询时出错,错误是: “必须声明标识符
完整代码如下:---
DECLARE
LS_STATUS VARCHAR2(1);
LS_COUNT VARCHAR2(3);
BEGIN
GO_BLOCK('BOO_BLOCK_CAST');
LS_COUNT:=0;
IF :BOO_BLOCK_CAST.NBT_CAST_NO IS NOT NULL THEN
GO_BLOCK('V_MM_FG_STOCK');
FIRST_RECORD;
LOOP
IF :V_MM_FG_STOCK.QNTY_PRODUCT =:QNTY_PRODUCT THEN
IF :V_MM_FG_STOCK.BUNDLE_ID IS NOT NULL THEN
IF :V_MM_FG_STOCK.NBT_CHK_BOX = 'Y' AND :V_MM_FG_STOCK.LN_PRODUCT < 12 THEN
BEGIN
UPDATE V_MM_FG_STOCK
SET MFS_CD_PROD_ACTL = '300',
MFS_SEC2_ACTL = :V_MM_FG_STOCK.SEC2_ACTL,
MFS_LN_PRODUCT = :V_MM_FG_STOCK.LN_PRODUCT,
MFS_QNTY_PRODUCT = :V_MM_FG_STOCK.QNTY_PRODUCT,
MFS_IND_AMEND = 'A',
MFS_STATUS = 'A'
WHERE MFS_BUNDLE_ID = :V_MM_FG_STOCK.BUNDLE_ID;
COMMIT;
LS_COUNT := LS_COUNT + 1;
EXCEPTION
WHEN NO_DATA_FOUND THEN
MESSAGE(SQLERRM);
MESSAGE(SQLERRM,NO_ACKNOWLEDGE);
WHEN OTHERS THEN
MESSAGE (SQLERRM);
MESSAGE (SQLERRM,NO_ACKNOWLEDGE);
END;
ELSE
MESSAGE('NO MORE BILLETS FOR THIS CAST NO.');
MESSAGE('NO MORE BILLETS FOR THIS CAST NO.',NO_ACKNOWLEDGE);
RAISE FORM_TRIGGER_FAILURE;
END IF;
ELSE
GO_BLOCK('V_MM_FG_STOCK');
NEXT_RECORD;
END IF;
ELSE
MESSAGE ('NEW QUANTITY SHOULD NOT BE MORE THAN OLD QUANTITY...');
RAISE FORM_TRIGGER_FAILURE;
EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
NEXT_RECORD;
END IF;
END LOOP;
ELSE
MESSAGE('PLEASE ENTER THE CAST NO. FIRST');
MESSAGE('PLEASE ENTER THE CAST NO. FIRST',NO_ACKNOWLEDGE);
raise form_trigger_failure;
END IF;
commit_form;
END;
何 -
V_MM_FG_STOCK is table name,
BOO_BLOCK_CAST is table name,
请尽快给我建议....我期待更好的回答..... 非常非常感谢提前........ 请帮助我...
答案 0 :(得分:1)
检查所有列名是否拼写正确。 检查表格是否有公共同义词。
答案 1 :(得分:0)
如果是表名并且您没有为此创建数据块,则首先在变量中指定此字段的值。 声明一个变量并在变量中分配这些字段的值然后尝试更新。 另外根据我的理解,你不能在这里使用导航。