Hi Andy,

sorry for the simple answer, I will now give some more solutions and in your
case with a value variable:

SELECT * FROM tbl_name WHERE column_name LIKE "%$username$%"

OR

ORACLE:

SELECT * FROM tbl_name WHERE column_name LIKE  '%' || #username# || '%'


Sybase/SQL Server:

SELECT * from tbl_name WHERE column_name LIKE  '%' + #username# + '%'

I don't know which database you are using, but I think one solution of the
solutions listed above will work!

Cheers,

Ronald

----- Original Message ----- 
From: "Andy Engle" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, March 26, 2004 11:41 PM
Subject: Re: [OT] "SELECT ... LIKE" with iBatis


> Ronald Rotteveel <[EMAIL PROTECTED]> wrote:
>
> > Hi Andy,
> >
> > we have a same kind of statement in our xml file and it looks like
> > this:
> >
> > <mapped-statement name="statementName" result-map="result">
> >  SELECT * FROM tbl_name WHERE column_name LIKE '%';
> > </mapped-statement>
>
> Right, but I was running into trouble with where to put my #value#.
> Did you have anything like that in there?  I tried stuff like
> '%#value#%', %#value#%, and whatever else but it didn't seem to want to
> do anything but sit there and look at me.
>
>
> Andy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to