(assuming the reactorfactory is in application scope)
<CFSET userGateway = Application.Reactor.createGateway("user") />
<CFSET query =userGateway.createquery
()>
<CFSET query.getWhere().IsNull("tablename","fieldname")>
<CFSET userQuery =userGateway.getByQuery(query)>
<cfdump var="#userQuery#">
SO, I don't think it is a bug, about 60% of cases can be handled by getbyfields() the other 40% that deal with nulls, ors, joins etc can be handled by custom OO query.
Doug S.
<CFSET query.getWhere().IsNull("tablename","fieldname")>
<CFSET userQuery =userGateway.getByQuery(query)>
<cfdump var="#userQuery#">
SO, I don't think it is a bug, about 60% of cases can be handled by getbyfields() the other 40% that deal with nulls, ors, joins etc can be handled by custom OO query.
Doug S.
On 6/28/06, Mark Stanton <
[EMAIL PROTECTED]> wrote:
Hey All
Quick query for you. I've got a "supplier" table defined in MySQL4 as follows:
CREATE TABLE `supplier` (
`SupplierUUID` varchar(36) NOT NULL default '',
`Name` varchar(255) NOT NULL default '',
`SMEStatus` tinyint(4) default NULL,
`ABN` varchar(36) NOT NULL default '',
PRIMARY KEY (`SupplierUUID`),
UNIQUE KEY `ABN` (`ABN`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
The SMEStatus table is being used to store:
1 for yes
0 for no
NULL for not checked.
Records are initially created with a NULL value. Every 6 months we
export, send a CSV continaing all the records with an SMEStatus of
NULL to another organisation, they enter yes/no against each record in
that column and return the CSV to us. We import it back in and set the
value.
I am currently working on the export process and am looking to fetch
all the records with a NULL value, but getByFields borks in both the
following cases:
variables.objSupplierGateway.getByFields (SMEStatus="")
and
variables.objSupplierGateway.getByFields(SMEStatus="NULL")
Should I just use -1 to represent unchecked or should I log a bug?
Mark
--
Mark Stanton
Gruden Pty Ltd
http://www.gruden.com
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
