i am getting error when trying to run an update query in key commit trigger in oracle d2k the error is: "identifier must be declare
the complete code is as follows:---
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;
wherever--
V_MM_FG_STOCK is table name,
BOO_BLOCK_CAST is table name,
pls suggest me as quickly as possible ....i m looking forward to better for its answer..... very very thanks in advance........ plz help me out...