i want to create stored procedure with LIKE operation but getting error and the answers** that i saw was outdated for current version. How can i write the procedure correctly
Getting same error: 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 'LIKE '%' + @Name + '%' AND; brand
LIKE '%' + @Brand+ '%' AND; `description' at line 2
Tried these:
BEGIN
`name` LIKE '%' + @Name + '%' AND
`brand` LIKE '%' + @Brand+ '%' AND
`description` LIKE '%' + @Desc + '%' AND
`type` LIKE '%' + @Type + '%';
END
BEGIN
`name` LIKE CONCAT('%', @Name, '%') AND
`brand` LIKE CONCAT('%', @Brand, '%') AND
`description` LIKE CONCAT('%', @Desc, '%') AND
`type` LIKE CONCAT('%', @Type, '%');
END
doc: https://dev.mysql.com/doc/refman/5.7/en/create-procedure.html