0

please help me out in the following code its a syntax error but i don't understand where is the error i tried to run this trigger on Wamp server here is the code:

CREATE TRIGGER Drivers_type_constraint BEFORE INSERT ON Cars
     FOR EACH ROW 
     BEGIN
        IF ((NEW.driver_name='null')||(NEW.driver_age<17)) THEN
             DELETE from Drivers where driver_id = NEW.driver_id;
        END IF;
     END;
     /

Error

you have an error in your SQL Syntax; Check the manual that correspond to your sql server version for the right syntax to use near '' at line 8

If anyone want to suggest any idea it would be appreciated thanks in advance.

6
  • So what error do you get? Commented Oct 19, 2014 at 9:16
  • "you have an error in your SQL Syntax; Check the manual that correspond to your sql server version for the right syntax to use near '' at line 8" Commented Oct 19, 2014 at 9:20
  • i am using wamp server actually Commented Oct 19, 2014 at 9:20
  • possible duplicate of Syntax error on MYSQL Trigger Commented Oct 19, 2014 at 9:24
  • So what is that stray / doing there in line 8? Is it meant as a delimited? Then where is that delimiter defined? Commented Oct 19, 2014 at 9:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.