Not sure why this is returning invalid syntax:
CREATE DEFINER=`root`@`localhost` PROCEDURE `AddColor`(
IN hexvalue varchar(7),
IN notes varchar(50))
BEGIN
IF hexvalue REGEXP '^#[0-9A-F]{6}$' THEN
INSERT INTO data.colors(hexvalue,notes) VALUES (hexvalue,notes);
ELSE
SIGNAL SQLSTATE '400'
SET MESSAGE_TEXT = 'Invalid hex value specified';
END IF;
END
There doesn't seem to be any errors when writing it in.
DELIMITER //or similar as described here? dev.mysql.com/doc/refman/8.0/en/stored-programs-defining.html You code works otherwise exceptSQLSTATE '400'should be changed to a 5 digit number.