Link to home
Start Free TrialLog in
Avatar of cavtel
cavtel

asked on

DB2 Trigger Error.

Hi,
I am trying to write a trigger on a table. I have written following code
CREATE TRIGGER QGPL/TRG_TEST                              
AFTER INSERT ON QGPL/TESTTRIGGER                              
REFERENCING NEW ROW AS NROW                      
FOR EACH ROW MODE DB2ROW                                                

WHEN (NROW.SOSTAT = 'ASSN')  
                                                           
BEGIN                                                      
  INSERT INTO QGPL/TESTTRIGGER values(NROW.SONO, 'AUTO', NROW.SOTYP);       
END

But i am getting error as
Character ''' not valid following string ',         '.              
String ');        ' contains a character that is not valid.          
Please help.
Thanks.
Avatar of Kent Olsen
Kent Olsen
Flag of United States of America image


DB2 error messages tend to steer your eyes away from the real problem.  (BTW, this isn't unique to IBM's SQL.)

Remove the ';' from the INSERT statement and try again.


Kent
ASKER CERTIFIED SOLUTION
Avatar of Member_2_2484401
Member_2_2484401
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial