Prooblem writing empty strings to mySQL db

[prev] [thread] [next] [Date index for 2004/12/22]

From: cdbi
Subject: Prooblem writing empty strings to mySQL db
Date: 01:56 on 22 Dec 2004
Hi, I'm new to Class::DBI and I've done some searching and could not figure this problem out.  I'm trying to write an empty string to a column in my database, but I get a SQL syntax error instead.

Without giving all the code, I'm essentially doing this:

my $setting = My::Setting->retrieve(mac => "blah", name => "foo");
$setting->set(value => "");
$setting->update();

Then I run the code with DBI_TRACE=2, so I see the SQL, and it looks like:

SET value =
WHERE mac='blah' AND name='foo'

And this generates an error.  Whereas this SQL would work fine...

SET value = ''
WHERE mac='blah' AND name='foo'

So how do I get Class::DBI to do the latter?

Thanks for any help,

-Dave

Prooblem writing empty strings to mySQL db
cdbi 01:56 on 22 Dec 2004

Re: Prooblem writing empty strings to mySQL db
Adam Przygienda 09:09 on 22 Dec 2004

Problem writing strings to database
cdbi 21:18 on 22 Dec 2004

Re: Problem writing strings to database
Tony Bowden 01:10 on 23 Dec 2004

Re: Problem writing strings to database
Tony Bowden 09:03 on 23 Dec 2004

Re: Problem writing strings to database
Tim Bunce 15:24 on 23 Dec 2004

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52