Hi,
I have a stored proc wihch takes in one param. It has the following code
CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_GetStreetName`(
IN STREET_NAME varchar(50)
)
BEGIN
SELECT `name` as MY_NAME from table_address
where street LIKE %STREET_NAME%;
END//
DELIMITER ;
The above query has a syntax error - complaining about the % signs.
I also used:
where street LIKE STREET_NAME;
and in the parameter, I specified the param value as "%"+street+"%" - but the query returned no results.
My question is, how do I do a [street LIKE '%Brown%'] but from within a stored procedure?
Thanks!