Yes, 

You just need to set the mode for the next condition you want to add to your 
where clause.
You'll use only the code I provided if you want to do more complex conditions 
like the example I previously gave.

João Fernandes

-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Michael Lantz
Sent: Tue 14-Feb-06 11:20 PM
To: [email protected]
Subject: RE: Reactor For CF Using WHERE and OR
 
Ah... I now see what setMode() is for.  I was wondering about that.

So how does where you call the setmode function affect the outcome?  Can I
change setmode multiple times while building a query?

Michael 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean
Corfield
Sent: Tuesday, February 14, 2006 4:10 PM
To: [email protected]
Subject: Re: Reactor For CF Using WHERE and OR

On 2/14/06, João Fernandes <[EMAIL PROTECTED]> wrote:
> <cfset gtw = myreactor.creategateway("mytable")>
> <cfset query = gtw.createquery()>
> <cfset where1 = 
> createOBject("component","reactor.query.where").init(query)>

You don't need to create where objects like that! Reactor lets you combine
where clauses:

<cfset gtw = myreactor.creategateway("mytable")>
<cfset query = gtw.createquery()>
<cfset where = gtw.getwhere()>
<!--- add first where clause: --->
<cfset where.isLike("mytable","field1",myvar)>
<!--- default mode is 'and' - change it to 'or' ---> <cfset
where.setMode("or")>
<!--- add second where clause: --->
<cfset where.isLike("mytable","field2",myvar)>
<!--- execute combined query: --->
<cfset gtw.getByQuery(query)>
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



-- 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/

<<winmail.dat>>

Reply via email to