Question

Why isn't this working?

DELIMITER ;//

CREATE PROCEDURE `blah`
(
  SearchText varchar(4000)
)
BEGIN
  SELECT *
  FROM table_name
  WHERE table_name.StringField LIKE '%' + SearchText + '%'; -- This is where the code is breaking
END;//
Was it helpful?

Solution

Try using:

CONCAT('%', SearchText ,'%')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top