Sue Tippett
asked on
Trigger issue Expected ORDER/REFERENCING/FOR/WHEN keywords or a triggered action block
I am new to triggers for Teradata. from the staging table if the submit quantity changes on records where the type code is either 'stock' or 'ship' update the Inventory table quantity.
This is the message I am getting:
Expected ORDER/REFERENCING/FOR/WHEN keywords or a triggered action block
REPLACE TRIGGER stgInvChng_Trg
AFTER UPDATE OF (SbmtQty) ON stgInvChng
NEW AS after row
FOR EACH ROWWHEN(afterrow.TypeCd IN ('Stock’,'Ship' ))
( Update i
FROM stgInvChng s, Invtry i
SET InvQty = SbmtQty
Where
New.Itme = s.Item AND
s.Item = i.item);
This is the message I am getting:
Expected ORDER/REFERENCING/FOR/WHEN
REPLACE TRIGGER stgInvChng_Trg
AFTER UPDATE OF (SbmtQty) ON stgInvChng
NEW AS after row
FOR EACH ROWWHEN(afterrow.TypeCd IN ('Stock’,'Ship' ))
( Update i
FROM stgInvChng s, Invtry i
SET InvQty = SbmtQty
Where
New.Itme = s.Item AND
s.Item = i.item);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
With all the scenario I tried prior to posting, Punctuation );); was the real issue. Plus I didn't need to attempt to filter "FOR EACH ROW WHEN"
Good to hear.... And very happy you have your solution :)
I do wish we had "FOR EACH ROW" in SQL Server triggers !
I do wish we had "FOR EACH ROW" in SQL Server triggers !
ASKER