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/

