'Create trigger in MariaDB

We're currently looking to port from Oracle into MariaDb, but are struggling to recreate old triggers.

Specifically, we're currently trying to execute:

CREATE DEFINER=`admin`@`%` TRIGGER SET_AUTHOR_EVENT_ID BEFORE INSERT ON author_event
FOR EACH ROW 
BEGIN
    SET NEW.ID = AUTHOR_EVENT_ID_SEQ.NEXTVAL;
END;

but are getting the following error message :

SQL Error [1064] [42000]: (conn=3153) 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 1

The syntax we're using appears to be inline with the documentation we can find, but there's definitely an error in there somewhere. Looking into the specifics of the error message (i.e. 1064) appears to yield few clues...any help/pointers/suggestions gratefully received.

Thanks



Solution 1:[1]

Adding DELIMITER as Paul said, worked for me.

DELIMITER $$    
CREATE DEFINER=`admin`@`%` TRIGGER SET_AUTHOR_EVENT_ID BEFORE INSERT ON author_event
FOR EACH ROW 
BEGIN
    SET NEW.ID = AUTHOR_EVENT_ID_SEQ.NEXTVAL;
END; 
$$

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 andreyro