I want to crate a very basic routine in my mqsql mariadb that inserts data into a table.
While testing in the SQL Editor, everything works fine:
SELECT @userid:=rowid from userdata where username like 'testuser';
SELECT @now:=NOW();
INSERT INTO tracks(userid, trackname, link, timestamp) VALUES (@userid, 'test', 'test', @now);
But when I want to paste this code into a routine I get the error:
MySQL said: #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 'SELECT @now:=NOW(); INSERT INTO tracks(userid, trackname, link, timestamp) VA' at line 3
I selected the SecurityType "DEFINER" and SQL data access to "NO SQL" or to "MODIFIES SQL DATA".
Any Ideas?