What happens if you *want* to put an empty string into a nullable field?
(not something I've ever needed so far, but would be nice to know if/when the occasion arises) -- Peter On 7/14/06, Doug Hughes <[EMAIL PROTECTED]> wrote:
Gareth, I know I'm the author of Reactor so I should know the answer to things like this for sure, but I'm only 99% sure this will work: If you have a column that accepts null values and you provide an empty string Reactor should translate this to a null value on insert or update. Doug ________________________________ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gareth Cole Sent: Friday, July 14, 2006 8:44 AM To: [email protected] Subject: RE: [Reactor for CF] updating a column to NULL Hi Folks, My apologies for posting this again, but I'm really stuck. Reactor has been really great for my current project and saved me loads of time, but until I figure out a way of doing this, I can't launch the site. Basically what I want to do is: myRecord = reactor.createRecord("MyTable"); myRecord.setMyPK(1); myRecord.load(); myRecord.setMyCol(null); // where my 'myCol' is an integer database table that can be null myRecord.save(); The problem is setting the column to null. Not passing an argument throws an error, likewise does passing an empty string. I'd really appreciate if someone could show me how to do this with reactor, or at least point me in the right direction. I'd imagine this is a fairly common database task, so someone must have tried this before. Thanks, Gareth -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gareth Cole Sent: 13 July 2006 18:04 To: [email protected] Subject: [Reactor for CF] updating a column to NULL Hi, one of my tables has an integer column 'myCol' that can be NULL. I can set this to an integer, but I'm having trouble setting it to NULL: setMyCol() throws an error because there's no argument passed setMyCol("") throws an error because the argument isn't numeric How can I do this using reactor? Thanks -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 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/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Reactor for ColdFusion Mailing List [email protected] Archives at: http://www.mail-archive.com/reactor%40doughughes.net/ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

