I'm having trouble with triggers. I want to set the value in a column based on other columns in the row and a lookup to another table. It looks like HANA doesn't let me change the value of the column before I insert the row. I've tried BEFORE and AFTER INSERT, BEFORE and AFTER UPDATE.
I get a sql syntax error Here is the trigger:
CREATE TRIGGER "SRC_XXX"."F0001_TRG" BERFORE INSERT ON "SRC_XXX"."F0001" REFERENCING NEW ROW mynewrow
FOR EACH ROW
BEGIN
DECLARE
v_abat1 NCHAR(3);
select abat1 into v_abat1 from src_xxx.f1111
where aban8 = :MYNEWROW.wan8
and abat1 in ('Q', 'Z');
if :v_abat1 = 'E' or :v_abat1 = 'S' or :v_abat1 = 'X' then
MYNEWROW.EDW_WWTYC := 'X';
else
MYNEWROW.EDW_WWTYC := :MYNEWROW.WWTYC;
end if;
END;
Thanks,
Clive