MySQL, Stored Procedure, LIKE, % and a string variable...the combination don't work

Hello all, I have a MySQL question and I was wondering if anyone could help.

Does anyone know how get a variable to sit in a LIKE stored procedure statement in MySQL?

ie…

ste_Name LIKE str_Keyword (but with the wildcard % either side)

I have tried the following…

‘%’ + str_Keyword + ‘%’
‘%str_Keyword%’
‘%’.str_Keyword.‘%’

The stored procedure works fine when I remove the percentages, but I really need them in there.

Anyone came across this? I haven’t had much success on Google-ing the issue.

Any help would be brill as I am totally stuck!

Thanks,

Tim

CONCAT(‘%’,str_Keyword,‘%’)

:cool:

Thanks man, works a treat :slight_smile: MySQL seems so so so much stricter than MS SQL