On Thu, Jul 9, 2009 at 10:11 AM, Joel Bernstein <[email protected]> wrote:

>
> On 9 Jul 2009, at 16:00, fREW Schmidt wrote:
>
>> On Thu, Jul 9, 2009 at 9:36 AM, Mike South <[email protected]> wrote:
>> First thing I would try is going to
>>
>> http://search.cpan.org/~timb/DBI/DBI.pm<http://search.cpan.org/%7Etimb/DBI/DBI.pm>
>>
>> search page for NULL, see if that helps.
>>
>> I looked through it and didn't see anything.  Someone told me it is a
>> function of the DBD so I am looking through DBD::ODBC, but so far, no luck.
>>
>
>
> He gave you a pointer to the answer already.
> Did you look at every occurrence of NULL on the DBI.pm POD?
>
> I just searched the page for NULL and found the relevant info that you
> needed regarding how NULL values are represented to Perl and thus how to
> enter NULLs into the database. Do you really not see it?
>

Oh yeah, I saw that for sure.  I was hoping for some kind of setting that I
could set that would convert '' to null in fields that aren't strings.  I
gave up and did this:

method fix_nullable($param) {
   if ($param eq '' ) {
      return undef;
   }
}

my $params = $self->query->Vars;
$params->{$_} = $self->fix_nullable($params->{$_}) for (qw{
      fixture_amount fixture_id photo_id photo_neg_id  });

-- 
fREW Schmidt
http://blog.afoolishmanifesto.com
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to