João,

Yep, that does work.  I was trying to do it without using createObject. I
can see now why that didn't work.

I wonder, though, is there a simpler way to do this? Do I really need to use
this many lines of code and instantiate that many objects?

Doug, is this the proper way, or are we missing something?

Michael

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of João
Fernandes
Sent: Tuesday, February 14, 2006 3:06 PM
To: [email protected]
Subject: RE: Reactor For CF Using WHERE and OR

Michael,

Look at the Where.cfc, there is 1 method called "orWhere" that accepts 2
"reactor.query.where" objects.

it should work something like this:

<cfset gtw = myreactor.creategateway("mytable")>
<cfset query = gtw.createquery()>
<cfset where1 = createOBject("component","reactor.query.where").init(query)>
<cfset where1.isLike("mytable","field1",myvar)>
<cfset where2 = createOBject("component","reactor.query.where").init(query)>
<cfset where2.isLike("mytable","field2",myvar)>
<cfset query.getwhere().orWhere(where1,where2)>
<cfset gtw.getByQuery(query)>

It should work (I can't test it because I don't have any server running
here)

João Fernandes

-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Michael Lantz
Sent: Tue 14-Feb-06 8:39 PM
To: [email protected]
Subject: Reactor For CF Using WHERE and OR
 
Hey everyone,
 
OK, I am looking at this getWhere structure, and I don't quite understand
something.
 
How would I write a query like this using Reactor:
 
SELECT * FROM myTable
WHERE Field1 LIKE '#myvar#' OR Field2 LIKE '#myvar#'
 
I know it has something to do with orWhere(), but I just don't see exactly
how it works.
 
Thanks!
 
Michael




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

Reply via email to