Click here to Skip to main content
15,888,521 members

Comments by harristars (Top 44 by date)

harristars 27-May-19 7:10am View    
my trigger is not updating. right now i dont have an error but its not updating the column that it is suppose to update.what could be the problem.

DELIMITER //
CREATE TRIGGER `after_update_debt_defaulters` AFTER INSERT ON `defaulters`
 FOR EACH ROW BEGIN
       IF ( EXISTS (
            SELECT DISTINCT `KRAPIN` FROM defaulters WHERE `Debt_Amount` = '0'
           )   
       )
        THEN
            UPDATE users 
            SET users.debtor = '0'
            WHERE KRAPIN = NEW.KRAPIN;
        END IF;
END
harristars 27-May-19 6:04am View    
i have included the DELIMITER // at the beginning and also at the END // and now i am getting the another
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE KRAPIN = NEW.KRAPIN;
END IF;
END' at line 11
harristars 27-May-19 5:54am View    
i have removed but its giving me this error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 10
harristars 27-May-19 5:40am View    
even after removing semicolon i get the same error.
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AFTER insert on defaulters
FOR EACH ROW
BEGIN
IF ( EXISTS (
' at line 2
harristars 27-May-19 5:20am View    
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AFTER insert on defaulters
FOR EACH ROW
BEGIN
IF ( EXISTS (
' at line 2