Mysql Like statement - blank spaces

View: New views
1 Messages — Rating Filter:   Alert me  

Mysql Like statement - blank spaces

by Joseph Piron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all,

I'm trying to use the like statement of mysql to search for text in my table but I have a problem.
Indeed, here's my statement:

        <select id="searchSpecs" resultMap="Spec">
            select * from specs
            where (
            SpecDownload_Data_Id_
FactoryCode like '%#value#%' or
            SpecDownload_Data_Id_ProgramCode like '%#value#%')
        </select> 

But according to the logs, this is interpreted as :    like '% param0 %'   
with extra blanks... so the query is unsuccessful.

Am I doing sthg wrong ?

Thanks a lot for your answers.