0

I can't resolve this error for my trigger. What's wrong?

CREATE OR REPLACE TRIGGER update_count
AFTER UPDATE ON form_data 
IS
BEGIN
   SET NOCOUNT ON;
   IF(UPDATE(januaryValue))  
       BEGIN
           UPDATE form_count C
           SET value = januaryValue
           FROM form_data D
           INNER JOIN form_count ON C.idData = D.idData;
       END;
   END IF; 
END;

I change it and I have another error: Error at line 3: PLS-00103: Encountered the symbol "BEGIN" when expecting one of the following: ) , * & = - + < / > at in is mod remainder not rem => <> or != or ~= >= <= <> and or like like2 like4 likec as between overlaps || multiset year day member submultiset

CREATE OR REPLACE TRIGGER update_count
AFTER UPDATE ON form_data 
FOR EACH ROW
BEGIN
IF(UPDATE(januaryValue))
       BEGIN
           UPDATE form_count 
           SET value = new.januaryValue
           WHERE idData = new.idData
       END; 
END IF; 

END

Flo
  • 55
  • 1
  • 7
  • Oracle does not support `JOIN` in an UPDATE: https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_10008.htm#SQLRF01708 –  Feb 11 '15 at 15:30
  • I have never ever seen those syntaxes in the trigger code. Are you sure you are dealing with Oracle database? – Lalit Kumar B Feb 11 '15 at 15:45
  • 1
    Have you looked at the [the documentation](http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/create_trigger.htm#LNPLS01374) for any of this at all? Continually adding further errors isn't going to go down well in the longer run - you're going to have to learn how to help yourself. For instance it's UPDATING not UPDATE if you're checking to see if the trigger is updating. But, as the trigger is an UPDATE only trigger there's no need to have this at all. – Ben Feb 11 '15 at 17:30
  • It is just because I have blocks for februaryValue also and so on. – Flo Feb 11 '15 at 17:42

0 Answers0