You need to use the last argument to tell
it how to match. For example:
<cfset Query.getWhere().isLike("Person",
"firstname", "co", “left”)>
<cfset Query.getWhere().isLike("Person",
"firstname", "co", “right”)>
Etc. Dump Query.getWhere() to see the arguments.
Doug
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Doug Sims
Sent: Friday, June 09, 2006 5:21
PM
To: [email protected]
Subject: Re: [Reactor for CF]
using wildcard(%) in gateway
Thanks,
but this doesn't seem to work for me.
When I use IsLike() I get any match that contains the string, and it makes no
difference if I use the '%'
For example:
<cfset Query.getWhere().isLike("Person", "firstname",
"co%")>
will return 'cody' as well as 'marcos'. I need only cody returned, as this is
for a rolodex type contact list s(o everyone needs to only appear once, and
under the right letter.
Doug S
On 6/9/06, Cody
Caughlan <[EMAIL PROTECTED]>
wrote:
I accomplish that task by
doing this:
<cfset Query = PersonGateway.createQuery()>
<cfset Query.getWhere().isLike("Person", "firstname",
"co%")>
<cfset people = PersonGateway.getByQuery (Query)>
It looks like your only difference is you are using "isEqual()" where
you should be using "isLike()".
/Cody
Doug Sims wrote:
> I am tring to pull back all records that start with a certain letter for
> example, the letter H.
>
> I first tried this:
> <CFSET memberQuery
=membergateway.getbyfields(lastname="H%")>
> but get no records.
>
> I then tried a custom query, both with islike() and isequal()
>
> <CFSET
query.getWhere().isEqual("member", "lastname",'H%')>
> <CFSET order =
query.getorder().setasc("member","familyheadID")>
> <CFSET membergateway.createquery().setorder(order)>
> <CFSET memberQuery
=membergateway.getByQuery(query)>
>
> I don't have access to see the debug, so I can't really tell what is
> going on with the generated query. any suggestions on how to do this?
>
> Thanks,
> Doug S.
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- --
> Reactor for ColdFusion Mailing List
> [email protected]
> Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--